forked from svzdev/doudizhu
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.sql
More file actions
23 lines (19 loc) · 712 Bytes
/
Copy pathschema.sql
File metadata and controls
23 lines (19 loc) · 712 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# mysql --u root -p < schema.sql
CREATE DATABASE IF NOT EXISTS ddz DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE TABLE IF NOT EXISTS ddz.account (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
email VARCHAR(40) NOT NULL UNIQUE,
username VARCHAR(40) NOT NULL,
password VARCHAR(100) NOT NULL,
ip_addr VARCHAR(100) NOT NULL,
created_date DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_date DATETIME ON UPDATE CURRENT_TIMESTAMP
);
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,
c_id INT NOT NULL,
round VARCHAR(100) NOT NULL,
created_time DATETIME DEFAULT CURRENT_TIMESTAMP
);