윤준석

ADD: deploy.sh and undeploy.sh for testing deployment and undeployment db container

#!/usr/bin/env bash
docker build -t mamuri-db .
docker-compose up -d
\ No newline at end of file
CREATE DATABASE mamuri_db;
USE mamuri_db;
CREATE TABLE user
(
id INT(10) NULL AUTO_INCREMENT
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
user_id INT NOT NULL
);
CREATE TABLE keyword
(
id INT NOT NULL,
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
keyword VARCHAR NULL
);
CREATE TABLE user_keyword
(
id INT NOT NULL AUTO_INCREMENT,
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
user_id INT NOT NULL,
keyword_id INT NOT NULL,
FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE,
......@@ -22,7 +25,7 @@ CREATE TABLE user_keyword
CREATE TABLE item
(
id INT NOT NULL,
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
keyword_id INT NOT NULL,
platform VARCHAR NOT NULL,
name VARCHAR NOT NULL,
......@@ -35,7 +38,7 @@ CREATE TABLE item
CREATE TABLE item_check
(
id INT NOT NULL AUTO_INCREMENT,
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
item_id INT NULL,
user_id INT NULL,
FOREIGN KEY (item_id) REFERENCES item (id) ON DELETE CASCADE,
......
#!/usr/bin/env bash
docker-compose down
docker image rm mamuri-db
\ No newline at end of file