Toggle navigation
Toggle navigation
This project
Loading...
Sign in
박시진
/
mamuri-bot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
윤준석
2022-05-10 23:20:46 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5edca4cf61c0f9d3be4caf3a1d90cc082798f7dd
5edca4cf
1 parent
72a001ac
FIX: create_db.sql for varchar size
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
database/mysql_init/create_db.sql
database/mysql_init/create_db.sql
View file @
5edca4c
...
...
@@ -4,43 +4,43 @@ USE mamuri_db;
CREATE
TABLE
user
(
id
INT
NOT
NULL
AUTO_INCREMENT
PRIMARY
KEY
,
id
INT
AUTO_INCREMENT
PRIMARY
KEY
,
user_id
INT
NOT
NULL
);
CREATE
TABLE
keyword
(
id
INT
NOT
NULL
AUTO_INCREMENT
PRIMARY
KEY
,
keyword
VARCHAR
NULL
id
INT
AUTO_INCREMENT
PRIMARY
KEY
,
keyword
VARCHAR
(
150
)
NULL
);
CREATE
TABLE
user_keyword
(
id
INT
NOT
NULL
AUTO_INCREMENT
PRIMARY
KEY
,
id
INT
AUTO_INCREMENT
PRIMARY
KEY
,
user_id
INT
NOT
NULL
,
keyword_id
INT
NOT
NULL
,
FOREIGN
KEY
(
user_id
)
REFERENCES
user
(
id
)
ON
DELETE
CASCADE
,
FOREIGN
KEY
(
keyword_id
)
REFERENCES
keyword
(
id
)
ON
DELETE
CASCADE
,
FOREIGN
KEY
(
keyword_id
)
REFERENCES
keyword
(
id
)
ON
DELETE
CASCADE
);
CREATE
TABLE
item
(
id
INT
NOT
NULL
AUTO_INCREMENT
PRIMARY
KEY
,
keyword_id
INT
NOT
NULL
,
platform
VARCHAR
NOT
NULL
,
name
VARCHAR
NOT
NULL
,
price
INT
NOT
NULL
,
thumbnail_url
VARCHAR
NULL
,
item_url
VARCHAR
NOT
NULL
,
extra_info
TEXT
NULL
,
created_at
DATETIME
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
id
INT
AUTO_INCREMENT
PRIMARY
KEY
,
keyword_id
INT
NOT
NULL
,
platform
VARCHAR
(
50
)
NOT
NULL
,
name
VARCHAR
(
100
)
NOT
NULL
,
price
INT
NOT
NULL
,
thumbnail_url
VARCHAR
(
255
)
NULL
,
item_url
VARCHAR
(
255
)
NOT
NULL
,
extra_info
TEXT
NULL
,
created_at
DATETIME
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
);
CREATE
TABLE
item_check
(
id
INT
NOT
NULL
AUTO_INCREMENT
PRIMARY
KEY
,
id
INT
AUTO_INCREMENT
PRIMARY
KEY
,
item_id
INT
NULL
,
user_id
INT
NULL
,
FOREIGN
KEY
(
item_id
)
REFERENCES
item
(
id
)
ON
DELETE
CASCADE
,
FOREIGN
KEY
(
user_id
)
REFERENCES
user
(
id
)
ON
DELETE
CASCADE
);
);
\ No newline at end of file
...
...
Please
register
or
login
to post a comment