Skip to content

Commit

Permalink
优化初始化sql文件
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Aug 10, 2018
1 parent 02e36ba commit 402b848
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

1.安装MySQL数据库, 执行:

mysql --user=root --password=your_password --database=ddz < schema.sql
mysql --user=root -p < schema.sql

2.安装Python3.6, 执行:

Expand Down
6 changes: 3 additions & 3 deletions schema.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- mysql --user=user --password=pwd --database=ddz < schema.sql
-- mysql --user=root -p < schema.sql

CREATE DATABASE IF NOT EXISTS ddz DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_general_ci;

CREATE TABLE IF NOT EXISTS account (
CREATE TABLE IF NOT EXISTS ddz.account (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
email VARCHAR(20) NOT NULL UNIQUE,
username VARCHAR(10) NOT NULL,
Expand All @@ -12,7 +12,7 @@ CREATE TABLE IF NOT EXISTS account (
updated_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS record (
CREATE TABLE IF NOT EXISTS ddz.record (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
a_id INT NOT NULL,
b_id INT NOT NULL,
Expand Down

0 comments on commit 402b848

Please sign in to comment.