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 22:19:32 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9fff107f4088b2f183fca344302f972bb511a101
9fff107f
1 parent
0b81b685
ADD: database initialization sql file
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
database/mysql_init/create_db.sql
database/mysql_init/create_db.sql
0 → 100644
View file @
9fff107
CREATE
DATABASE
secondhand
-
noti
-
bot
;
CREATE
TABLE
user
(
id
INT
(
10
)
NULL
AUTO_INCREMENT
);
CREATE
TABLE
keyword
(
id
INT
NOT
NULL
,
keyword
VARCHAR
NULL
);
CREATE
TABLE
user_keyword
(
id
INT
NOT
NULL
AUTO_INCREMENT
,
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
,
);
CREATE
TABLE
item
(
id
INT
NOT
NULL
,
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
);
CREATE
TABLE
item_check
(
id
INT
NOT
NULL
AUTO_INCREMENT
,
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
);
Please
register
or
login
to post a comment