Showing
1 changed file
with
11 additions
and
11 deletions
... | @@ -4,41 +4,41 @@ USE mamuri_db; | ... | @@ -4,41 +4,41 @@ USE mamuri_db; |
4 | 4 | ||
5 | CREATE TABLE user | 5 | CREATE TABLE user |
6 | ( | 6 | ( |
7 | - id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, | 7 | + id INT AUTO_INCREMENT PRIMARY KEY, |
8 | user_id INT NOT NULL | 8 | user_id INT NOT NULL |
9 | ); | 9 | ); |
10 | 10 | ||
11 | CREATE TABLE keyword | 11 | CREATE TABLE keyword |
12 | ( | 12 | ( |
13 | - id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, | 13 | + id INT AUTO_INCREMENT PRIMARY KEY, |
14 | - keyword VARCHAR NULL | 14 | + keyword VARCHAR(150) NULL |
15 | ); | 15 | ); |
16 | 16 | ||
17 | CREATE TABLE user_keyword | 17 | CREATE TABLE user_keyword |
18 | ( | 18 | ( |
19 | - id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, | 19 | + id INT AUTO_INCREMENT PRIMARY KEY, |
20 | user_id INT NOT NULL, | 20 | user_id INT NOT NULL, |
21 | keyword_id INT NOT NULL, | 21 | keyword_id INT NOT NULL, |
22 | FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE, | 22 | FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE, |
23 | - FOREIGN KEY (keyword_id) REFERENCES keyword (id) ON DELETE CASCADE, | 23 | + FOREIGN KEY (keyword_id) REFERENCES keyword (id) ON DELETE CASCADE |
24 | ); | 24 | ); |
25 | 25 | ||
26 | CREATE TABLE item | 26 | CREATE TABLE item |
27 | ( | 27 | ( |
28 | - id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, | 28 | + id INT AUTO_INCREMENT PRIMARY KEY, |
29 | keyword_id INT NOT NULL, | 29 | keyword_id INT NOT NULL, |
30 | - platform VARCHAR NOT NULL, | 30 | + platform VARCHAR(50) NOT NULL, |
31 | - name VARCHAR NOT NULL, | 31 | + name VARCHAR(100) NOT NULL, |
32 | price INT NOT NULL, | 32 | price INT NOT NULL, |
33 | - thumbnail_url VARCHAR NULL, | 33 | + thumbnail_url VARCHAR(255) NULL, |
34 | - item_url VARCHAR NOT NULL, | 34 | + item_url VARCHAR(255) NOT NULL, |
35 | extra_info TEXT NULL, | 35 | extra_info TEXT NULL, |
36 | created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP | 36 | created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP |
37 | ); | 37 | ); |
38 | 38 | ||
39 | CREATE TABLE item_check | 39 | CREATE TABLE item_check |
40 | ( | 40 | ( |
41 | - id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, | 41 | + id INT AUTO_INCREMENT PRIMARY KEY, |
42 | item_id INT NULL, | 42 | item_id INT NULL, |
43 | user_id INT NULL, | 43 | user_id INT NULL, |
44 | FOREIGN KEY (item_id) REFERENCES item (id) ON DELETE CASCADE, | 44 | FOREIGN KEY (item_id) REFERENCES item (id) ON DELETE CASCADE, | ... | ... |
-
Please register or login to post a comment