diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000..b749ef402a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,58 @@ +name: koin-local + +services: + mysql: + image: mysql:8.0.29 + command: + - --character-set-server=utf8mb4 + - --collation-server=utf8mb4_unicode_ci + environment: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: koin + MYSQL_USER: koin + MYSQL_PASSWORD: koin + ports: + - "13306:3306" + volumes: + - koin-local-mysql:/var/lib/mysql + healthcheck: + test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -uroot -p$${MYSQL_ROOT_PASSWORD} --silent"] + interval: 5s + timeout: 3s + retries: 30 + + redis: + image: redis:7.0.9 + command: ["redis-server", "--requirepass", "koin"] + ports: + - "16379:6379" + volumes: + - koin-local-redis:/data + healthcheck: + test: ["CMD-SHELL", "redis-cli -a koin ping | grep PONG"] + interval: 5s + timeout: 3s + retries: 30 + + mongo: + image: mongo:8.2.3 + environment: + MONGO_INITDB_ROOT_USERNAME: koin + MONGO_INITDB_ROOT_PASSWORD: koin + MONGO_INITDB_DATABASE: koin + ports: + - "27018:27017" + volumes: + - koin-local-mongo:/data/db + - koin-local-mongo-config:/data/configdb + healthcheck: + test: ["CMD-SHELL", "mongosh --quiet -u koin -p koin --authenticationDatabase admin --eval 'db.adminCommand({ ping: 1 }).ok' | grep 1"] + interval: 5s + timeout: 3s + retries: 30 + +volumes: + koin-local-mysql: + koin-local-redis: + koin-local-mongo: + koin-local-mongo-config: diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml new file mode 100644 index 0000000000..fa76e85eef --- /dev/null +++ b/src/main/resources/application-local.yml @@ -0,0 +1,82 @@ +jwt: + secret-key: local-jwt-secret-key-example-32chars!! + access-token: + expiration-time: 6000000 + +spring: + datasource: + url: jdbc:mysql://127.0.0.1:13306/koin?characterEncoding=utf8&useUnicode=true&mysqlEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true + username: koin + password: koin + + data: + redis: + host: 127.0.0.1 + port: 16379 + password: koin + mongodb: + uri: mongodb://koin:koin@127.0.0.1:27018/koin?authSource=admin + +swagger: + server-url: http://localhost:8080 + +aws: + ses: + access-key: test + secret-key: test + +s3: + bucket: test-bucket + custom_domain: https://static.example.com/ + +slack: + koin_event_notify_url: https://example.com/slack + koin_owner_event_notify_url: https://example.com/slack + koin_shop_review_notify_url: https://example.com/slack + koin_lost_item_notify_url: https://example.com/slack + logging: + error: https://example.com/slack + +koin: + admin: + shop: + url: http://localhost:3000/store + review: + url: http://localhost:3000/review + +OPEN_API_KEY_PUBLIC: test +OPEN_API_KEY_TMONEY: test + +fcm: + koin: + url: koin://local + +naver: + accessKey: test + secretKey: test + sms: + apiUrl: http://localhost:8888 + serviceId: test + fromNumber: "01000000000" + +cors: + allowedOrigins: + - http://localhost:3000 + - http://localhost:8080 + +cloudfront: + distribution-id: test + region: ap-northeast-2 + +user: + verification: + max-verification-count: 5 + +address: + api: + url: https://business.juso.go.kr/addrlink/addrLinkApi.do + key: test + +toss-payment: + secret-key: test_sk + api-base-url: https://api.tosspayments.com/v1/payments diff --git a/src/main/resources/db/cleanup/drop_idx_lecture_code_semester.sql b/src/main/resources/db/cleanup/drop_idx_lecture_code_semester.sql deleted file mode 100644 index 1e42c9dc7a..0000000000 --- a/src/main/resources/db/cleanup/drop_idx_lecture_code_semester.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `koin`.`lectures` DROP INDEX `idx_lecture_code_semester`; diff --git a/src/main/resources/db/migration/V100__add_users_notification_status_table.sql b/src/main/resources/db/migration/V100__add_users_notification_status_table.sql deleted file mode 100644 index fdefaf51b0..0000000000 --- a/src/main/resources/db/migration/V100__add_users_notification_status_table.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE user_notification_status -( - id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_id INT UNSIGNED NOT NULL, - last_notified_article_id INT NOT NULL, - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - UNIQUE KEY uk_user_id (user_id), - FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE -); diff --git a/src/main/resources/db/migration/V101__alter_event_articles_drop_unused_column.sql b/src/main/resources/db/migration/V101__alter_event_articles_drop_unused_column.sql deleted file mode 100644 index ee8edecc5d..0000000000 --- a/src/main/resources/db/migration/V101__alter_event_articles_drop_unused_column.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE event_articles -DROP COLUMN event_title, -DROP COLUMN nickname, -DROP COLUMN thumbnail, -DROP COLUMN comment_count; diff --git a/src/main/resources/db/migration/V102__drop_shop_notification_buffer.sql b/src/main/resources/db/migration/V102__drop_shop_notification_buffer.sql deleted file mode 100644 index a593a6f176..0000000000 --- a/src/main/resources/db/migration/V102__drop_shop_notification_buffer.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE IF EXISTS shop_notification_buffer; diff --git a/src/main/resources/db/migration/V103__alter_timetable_lecture_class_place_column.sql b/src/main/resources/db/migration/V103__alter_timetable_lecture_class_place_column.sql deleted file mode 100644 index 176ae8a36e..0000000000 --- a/src/main/resources/db/migration/V103__alter_timetable_lecture_class_place_column.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE timetable_lecture - MODIFY COLUMN class_place TEXT; diff --git a/src/main/resources/db/migration/V104__add_shop_benefit_detail.sql b/src/main/resources/db/migration/V104__add_shop_benefit_detail.sql deleted file mode 100644 index c25f2cb767..0000000000 --- a/src/main/resources/db/migration/V104__add_shop_benefit_detail.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `shop_benefit_category_map` - ADD COLUMN `detail` VARCHAR(20); diff --git a/src/main/resources/db/migration/V105__alter_lecture_semester_date_size.sql b/src/main/resources/db/migration/V105__alter_lecture_semester_date_size.sql deleted file mode 100644 index 620ec97aee..0000000000 --- a/src/main/resources/db/migration/V105__alter_lecture_semester_date_size.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE lectures MODIFY semester_date VARCHAR(10) NOT NULL; diff --git a/src/main/resources/db/migration/V106__alter_lecture_class_time_size.sql b/src/main/resources/db/migration/V106__alter_lecture_class_time_size.sql deleted file mode 100644 index 22d2dfaa7d..0000000000 --- a/src/main/resources/db/migration/V106__alter_lecture_class_time_size.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE lectures MODIFY class_time VARCHAR(255) NOT NULL; diff --git a/src/main/resources/db/migration/V107__update_coop_shop.sql b/src/main/resources/db/migration/V107__update_coop_shop.sql deleted file mode 100644 index 829b4aee53..0000000000 --- a/src/main/resources/db/migration/V107__update_coop_shop.sql +++ /dev/null @@ -1,45 +0,0 @@ -INSERT INTO `coop_semester` (`semester`, `from_date`, `to_date`, `is_applied`) -VALUES ('24-동계방학', '2024-12-23', '2025-03-02', 1); - -SET @SEMESTER_ID = LAST_INSERT_ID(); - -UPDATE `coop_semester` -SET `is_applied` = 0 -WHERE `id` = 1; - -INSERT INTO `coop_shop` (`name`, `phone`, `location`, `remarks`, `semester_id`) -VALUES ('학생식당', '041-560-1278', '학생회관 2층', '비계절학기 주말 미운영', @SEMESTER_ID), - ('복지관식당', '041-560-1778', '복지관 2층', '복지관식당 c코너 별도 운영(계절학기까지)', @SEMESTER_ID), - ('대즐', '041-560-1779', '복지관 1층', '배달 가능', @SEMESTER_ID), - ('서점', '041-560-1756', '복지관 1층', '점심시간 12:00 - 13:00', @SEMESTER_ID), - ('세탁소', '041-560-1763', '학생회관 2층', NULL, @SEMESTER_ID), - ('복사실', '041-560-1093', '학생회관 2층', '점심시간 11:30 - 12:30', @SEMESTER_ID), - ('복지관 참빛관 편의점', '041-560-1093', '복지관 1층, 참빛관 1층', NULL, @SEMESTER_ID), - ('미용실', '041-560-1769', '학생회관 1층', '예약제운영', @SEMESTER_ID), - ('오락실', '041-560-1472', '학생회관 1층', NULL, @SEMESTER_ID); - -SET @COOP_SHOP_ID = LAST_INSERT_ID(); - -INSERT INTO `coop_opens` (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) -VALUES (@COOP_SHOP_ID, '아침', 'WEEKDAYS', '08:00', '09:00'), - (@COOP_SHOP_ID, '점심', 'WEEKDAYS', '11:30', '13:30'), - (@COOP_SHOP_ID, '저녁', 'WEEKDAYS', '17:30', '18:30'), - (@COOP_SHOP_ID, '아침', 'WEEKEND', '휴점(예약)', '휴점(예약)'), - (@COOP_SHOP_ID, '점심', 'WEEKEND', '11:30', '13:30'), - (@COOP_SHOP_ID, '저녁', 'WEEKEND', '17:30', '18:30'), - (@COOP_SHOP_ID + 1, '점심', 'WEEKDAYS', '11:40', '13:30'), - (@COOP_SHOP_ID + 1, '점심', 'WEEKEND', '미운영', '미운영'), - (@COOP_SHOP_ID + 2, NULL, 'WEEKDAYS', '08:30', '19:00'), - (@COOP_SHOP_ID + 2, NULL, 'WEEKDAYS', '휴점', '휴점'), - (@COOP_SHOP_ID + 3, NULL, 'WEEKDAYS', '09:00', '18:00'), - (@COOP_SHOP_ID + 3, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 4, NULL, 'WEEKDAYS', '10:30', '16:00'), - (@COOP_SHOP_ID + 4, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 5, NULL, 'WEEKDAYS', '10:00', '16:00'), - (@COOP_SHOP_ID + 5, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 6, NULL, 'WEEKDAYS', '24시간', '24시간'), - (@COOP_SHOP_ID + 6, NULL, 'WEEKEND', '24시간', '24시간'), - (@COOP_SHOP_ID + 7, NULL, 'WEEKDAYS', '10:00', '16:00'), - (@COOP_SHOP_ID + 7, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 8, NULL, 'WEEKDAYS', '24시간', '24시간'), - (@COOP_SHOP_ID + 8, NULL, 'WEEKEND', '24시간', '24시간'); diff --git a/src/main/resources/db/migration/V108__add_coopshops.sql b/src/main/resources/db/migration/V108__add_coopshops.sql deleted file mode 100644 index 50a8b3f2cb..0000000000 --- a/src/main/resources/db/migration/V108__add_coopshops.sql +++ /dev/null @@ -1,18 +0,0 @@ -UPDATE coop_opens AS co - JOIN coop_shop AS cs ON co.coop_shop_id = cs.id - SET co.day_of_week = 'WEEKEND' -WHERE cs.name = '대즐'; - -INSERT INTO `coop_shop` (`name`, `phone`, `location`, `remarks`, `semester_id`) -VALUES ('우편취급국', '041-560-1758', '학생회관 1층', '점심시간 12:00-13:00', 2), - ('안경원', '041-560-1760', '복지관 1층', '점심시간 13:00-14:00', 2); - -SET @COOP_SHOP_ID = LAST_INSERT_ID(); - -INSERT INTO `coop_opens` (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) -VALUES (@COOP_SHOP_ID, NULL, 'WEEKDAYS', '09:00', '18:00'), - (@COOP_SHOP_ID, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 1, NULL, 'WEEKDAYS', '11:00', '17:00'), - (@COOP_SHOP_ID + 1, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 1, NULL, 'FRIDAY', '휴점', '휴점'); - diff --git a/src/main/resources/db/migration/V109__alter__semester.sql b/src/main/resources/db/migration/V109__alter__semester.sql deleted file mode 100644 index 9c150668a2..0000000000 --- a/src/main/resources/db/migration/V109__alter__semester.sql +++ /dev/null @@ -1,32 +0,0 @@ -alter table semester - add column year int unsigned, - add column term varchar(20); - -update semester set year = 2019, term = 'SECOND' where semester = '20192'; -update semester set year = 2019, term = 'SUMMER' where semester = '2019-여름'; -update semester set year = 2019, term = 'WINTER' where semester = '2019-겨울'; -update semester set year = 2020, term = 'FIRST' where semester = '20201'; -update semester set year = 2020, term = 'SECOND' where semester = '20202'; -update semester set year = 2020, term = 'SUMMER' where semester = '2020-여름'; -update semester set year = 2020, term = 'WINTER' where semester = '2020-겨울'; -update semester set year = 2021, term = 'FIRST' where semester = '20211'; -update semester set year = 2021, term = 'SECOND' where semester = '20212'; -update semester set year = 2021, term = 'SUMMER' where semester = '2021-여름'; -update semester set year = 2021, term = 'WINTER' where semester = '2021-겨울'; -update semester set year = 2022, term = 'FIRST' where semester = '20221'; -update semester set year = 2022, term = 'SECOND' where semester = '20222'; -update semester set year = 2022, term = 'SUMMER' where semester = '2022-여름'; -update semester set year = 2022, term = 'WINTER' where semester = '2022-겨울'; -update semester set year = 2023, term = 'FIRST' where semester = '20231'; -update semester set year = 2023, term = 'SECOND' where semester = '20232'; -update semester set year = 2023, term = 'SUMMER' where semester = '2023-여름'; -update semester set year = 2023, term = 'WINTER' where semester = '2023-겨울'; -update semester set year = 2024, term = 'FIRST' where semester = '20241'; -update semester set year = 2024, term = 'SECOND' where semester = '20242'; -update semester set year = 2024, term = 'SUMMER' where semester = '2024-여름'; -update semester set year = 2024, term = 'WINTER' where semester = '2024-겨울'; -update semester set year = 2025, term = 'FIRST' where semester = '20251'; - -ALTER TABLE semester - MODIFY COLUMN year INT UNSIGNED NOT NULL, - MODIFY COLUMN term VARCHAR(20) NOT NULL; diff --git a/src/main/resources/db/migration/V10__add_event_article_thumbnail_images_table.sql b/src/main/resources/db/migration/V10__add_event_article_thumbnail_images_table.sql deleted file mode 100644 index 9aa785dbbe..0000000000 --- a/src/main/resources/db/migration/V10__add_event_article_thumbnail_images_table.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE if not exists `event_article_thumbnail_images` -( - id INT UNSIGNED AUTO_INCREMENT NOT NULL, - event_id INT UNSIGNED NOT NULL, - thumbnail_image VARCHAR(255), - created_at TIMESTAMP NOT NULL, - updated_at TIMESTAMP NOT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `FK_EVENT_ARTICLE_THUMBNAIL_IMAGES_ON_EVENT_ARTICLES` FOREIGN KEY (`event_id`) REFERENCES `event_articles` (`id`) -); diff --git a/src/main/resources/db/migration/V110__add_lost_item_image_table.sql b/src/main/resources/db/migration/V110__add_lost_item_image_table.sql deleted file mode 100644 index 9e17c75746..0000000000 --- a/src/main/resources/db/migration/V110__add_lost_item_image_table.sql +++ /dev/null @@ -1,28 +0,0 @@ -CREATE TABLE `lost_item_articles` -( - `id` INT UNSIGNED AUTO_INCREMENT NOT NULL comment '고유 id' primary key, - `article_id` INT UNSIGNED NOT NULL comment '게시글 id', - `author_id` INT UNSIGNED NULL comment '작성자 id', - `category` VARCHAR(255) NOT NULL comment '분실물 카테고리', - `found_place` VARCHAR(255) NOT NULL comment '습득 장소', - `found_date` DATE NOT NULL comment '습득 날짜', - `is_deleted` TINYINT(1) NOT NULL DEFAULT 0 comment '게시글 삭제 여부', - `created_at` timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - `updated_at` timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '수정 일자', - CONSTRAINT `lost_item_article_fk_id` FOREIGN KEY (`article_id`) REFERENCES `new_articles` (`id`) ON DELETE CASCADE, - CONSTRAINT `lost_item_article_author_fk_id` FOREIGN KEY (`author_id`) REFERENCES `users` (`id`) ON DELETE CASCADE -); - -CREATE TABLE `lost_item_images` -( - `id` INT UNSIGNED AUTO_INCREMENT NOT NULL comment '고유 id' primary key, - `lost_item_id` INT UNSIGNED NOT NULL comment '분실물 게시글 id', - `image_url` VARCHAR(255) NOT NULL comment '분실물 이미지 url', - `is_deleted` TINYINT(1) NOT NULL DEFAULT 0 comment '게시글 삭제 여부', - `created_at` timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - `updated_at` timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '수정 일자', - CONSTRAINT `lost_item_image_fk_id` FOREIGN KEY (`lost_item_id`) REFERENCES `lost_item_articles` (`id`) ON DELETE CASCADE -); - -INSERT INTO `boards` (`id`, `name`) -VALUES (14, '분실물게시판'); diff --git a/src/main/resources/db/migration/V111__add_table_coop_names.sql b/src/main/resources/db/migration/V111__add_table_coop_names.sql deleted file mode 100644 index ca0ca56674..0000000000 --- a/src/main/resources/db/migration/V111__add_table_coop_names.sql +++ /dev/null @@ -1,18 +0,0 @@ -CREATE TABLE `coop_names` -( - `id` INT UNSIGNED AUTO_INCREMENT NOT NULL comment '고유 id' primary key, - `name` VARCHAR(255) NOT NULL comment '생협 운영장 이름' -); - -INSERT INTO `coop_names` (`name`) -VALUES ('학생식당'), - ('복지관식당'), - ('대즐'), - ('서점'), - ('세탁소'), - ('복사실'), - ('복지관 참빛관 편의점'), - ('미용실'), - ('오락실'), - ('우편취급국'), - ('안경원'); diff --git a/src/main/resources/db/migration/V112__delete_column_coop_shop_name.sql b/src/main/resources/db/migration/V112__delete_column_coop_shop_name.sql deleted file mode 100644 index 372e486c42..0000000000 --- a/src/main/resources/db/migration/V112__delete_column_coop_shop_name.sql +++ /dev/null @@ -1,11 +0,0 @@ -ALTER TABLE `coop_shop` - ADD COLUMN `coop_name_id` INT UNSIGNED comment '생협 운영장 고유 id', - ADD CONSTRAINT `coop_name_fk_id` FOREIGN KEY (`coop_name_id`) REFERENCES `coop_names` (`id`) ON DELETE CASCADE; - -UPDATE `coop_shop` AS cs - JOIN `coop_names` AS cn -ON cs.`name` = cn.`name` - SET cs.`coop_name_id` = cn.`id`; - -ALTER TABLE `coop_shop` - DROP COLUMN `name`; diff --git a/src/main/resources/db/migration/V113__atler_coop_opens_dazzle.sql b/src/main/resources/db/migration/V113__atler_coop_opens_dazzle.sql deleted file mode 100644 index 57438be54e..0000000000 --- a/src/main/resources/db/migration/V113__atler_coop_opens_dazzle.sql +++ /dev/null @@ -1,5 +0,0 @@ -UPDATE coop_opens AS co - JOIN coop_shop AS cs ON co.coop_shop_id = cs.id - JOIN coop_names AS cn ON cs.coop_name_id = cn.id - SET co.day_of_week = 'WEEKDAYS' -WHERE cn.name = '대즐' AND co.open_time = '08:30'; \ No newline at end of file diff --git a/src/main/resources/db/migration/V114__add_lost_item_reports_table.sql b/src/main/resources/db/migration/V114__add_lost_item_reports_table.sql deleted file mode 100644 index 5fbe894a92..0000000000 --- a/src/main/resources/db/migration/V114__add_lost_item_reports_table.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE IF NOT EXISTS `lost_item_reports` -( - id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, - lost_id INT UNSIGNED NOT NULL, - title VARCHAR(50) NOT NULL, - content VARCHAR(255) NOT NULL, - user_id INT UNSIGNED NOT NULL, - status VARCHAR(25) DEFAULT 'UNHANDLED', - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - FOREIGN KEY (`lost_id`) REFERENCES `lost_item_articles` (`id`) ON DELETE CASCADE, - FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE -); \ No newline at end of file diff --git a/src/main/resources/db/migration/V115__add_lost_item_column_is_council.sql b/src/main/resources/db/migration/V115__add_lost_item_column_is_council.sql deleted file mode 100644 index c948662608..0000000000 --- a/src/main/resources/db/migration/V115__add_lost_item_column_is_council.sql +++ /dev/null @@ -1,3 +0,0 @@ -alter table `lost_item_articles` - add column `type` VARCHAR(100) NOT NULL comment '게시글 타입' DEFAULT 'LOST', - add column `is_council` TINYINT(1) NOT NULL comment '작성자 총학생회 여부' DEFAULT '0'; diff --git a/src/main/resources/db/migration/V116__add_course_type.sql b/src/main/resources/db/migration/V116__add_course_type.sql deleted file mode 100644 index 5c98eb4407..0000000000 --- a/src/main/resources/db/migration/V116__add_course_type.sql +++ /dev/null @@ -1,9 +0,0 @@ --- 이수구분 테이블 생성 -CREATE TABLE if not exists `koin`.`course_type` -( - id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT comment '고유 id', - name VARCHAR(255) NOT NULL comment '이수 구분 이름', - is_deleted tinyint DEFAULT 0 comment '삭제 여부', - created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP comment '생성 일자', - updated_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP comment '수정 일자' -); diff --git a/src/main/resources/db/migration/V117__add_department.sql b/src/main/resources/db/migration/V117__add_department.sql deleted file mode 100644 index 983dfbffaa..0000000000 --- a/src/main/resources/db/migration/V117__add_department.sql +++ /dev/null @@ -1,22 +0,0 @@ --- 학과 테이블 생성 -CREATE TABLE if not exists `koin`.`department` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT comment '고유 id', - `name` VARCHAR(255) NOT NULL comment '학과 이름', - PRIMARY KEY (`id`), - created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP comment '생성 일자', - updated_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP comment '수정 일자' -); - -INSERT INTO `department` (name) -VALUES ('컴퓨터공학부'), - ('기계공학부'), - ('메카트로닉스공학부'), - ('전기전자통신공학부'), - ('디자인공학부'), - ('건축공학부'), - ('화학생명공학부'), - ('에너지신소재화학공학부'), - ('산업경영학부'), - ('고용서비스정책학과'), - ('학과공통'); diff --git a/src/main/resources/db/migration/V118__add_major.sql b/src/main/resources/db/migration/V118__add_major.sql deleted file mode 100644 index 48e8d4f48c..0000000000 --- a/src/main/resources/db/migration/V118__add_major.sql +++ /dev/null @@ -1,28 +0,0 @@ -CREATE TABLE if not exists `koin`.`major` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT comment '고유 id', - `name` VARCHAR(255) NOT NULL comment '전공 이름', - `department_id` INT UNSIGNED NOT NULL comment '학과 id', - PRIMARY KEY (`id`), - FOREIGN KEY (`department_id`) REFERENCES `department` (`id`), - created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP comment '생성 일자', - updated_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP comment '수정 일자' - ); - -INSERT INTO `major` (name, department_id) -VALUES ('컴퓨터공학전공', 1), - ('친환경자동차・에너지트랙전공', 2), - ('시스템설계제조전공', 2), - ('스마트모빌리티전공', 2), - ('생산시스템전공', 3), - ('제어시스템전공', 3), - ('디지털시스템전공', 3), - ('전기공학전공', 4), - ('전자공학전공', 4), - ('정보통신공학전공', 4), - ('디자인공학전공', 5), - ('건축공학전공', 6), - ('화학생명공학전공', 7), - ('에너지신소재공학전공', 8), - ('융합경영전공', 9), - ('데이터경영전공', 9) \ No newline at end of file diff --git a/src/main/resources/db/migration/V119__add_standard_graduation_requirements.sql b/src/main/resources/db/migration/V119__add_standard_graduation_requirements.sql deleted file mode 100644 index 393643e3d5..0000000000 --- a/src/main/resources/db/migration/V119__add_standard_graduation_requirements.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE if not exists `koin`.`standard_graduation_requirements` -( - id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT comment '고유 id', - year VARCHAR(20) NOT NULL comment '년도', - major_id INT UNSIGNED NOT NULL comment '전공 id', - course_type_id INT UNSIGNED comment '이수 구분 id', - required_grades INT NOT NULL comment '기준 학점', - FOREIGN KEY (course_type_id) REFERENCES course_type (id), - FOREIGN KEY (major_id) REFERENCES major (id), - is_deleted tinyint DEFAULT 0 comment '삭제 여부', - created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP comment '생성 일자', - updated_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP comment '수정 일자' -); diff --git a/src/main/resources/db/migration/V11__alter_notification_column_nullable.sql b/src/main/resources/db/migration/V11__alter_notification_column_nullable.sql deleted file mode 100644 index 0f17b55266..0000000000 --- a/src/main/resources/db/migration/V11__alter_notification_column_nullable.sql +++ /dev/null @@ -1,14 +0,0 @@ -alter table `notification` - modify app_path VARCHAR(255) NULL comment '앱 url'; - -alter table `notification` - modify title VARCHAR(255) NULL comment '제목'; - -alter table `notification` - modify message VARCHAR(255) NULL comment '메시지 내용'; - -alter table `notification` - modify image_url VARCHAR(255) NULL comment '이미지 url'; - -alter table `notification` - modify type VARCHAR(255) NULL comment '알림 타입'; diff --git a/src/main/resources/db/migration/V120__add_student_course_calculation.sql b/src/main/resources/db/migration/V120__add_student_course_calculation.sql deleted file mode 100644 index 6e695a8eb9..0000000000 --- a/src/main/resources/db/migration/V120__add_student_course_calculation.sql +++ /dev/null @@ -1,14 +0,0 @@ --- 학생 계산 테이블 생성 -CREATE TABLE if not exists `koin`.`student_course_calculation` -( - id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT comment '고유 id', - user_id INT UNSIGNED NOT NULL comment '유저 id', - standard_graduation_requirements_id INT UNSIGNED comment '기준 졸업 요건 id', - completed_grades INT NOT NULL DEFAULT 0 comment '이수 학점', - FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE, - FOREIGN KEY (standard_graduation_requirements_id) REFERENCES - standard_graduation_requirements (id), - is_deleted tinyint DEFAULT 0 comment '삭제 여부', - created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP comment '생성 일자', - updated_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP comment '수정 일자' -); diff --git a/src/main/resources/db/migration/V121__add_general_education_area.sql b/src/main/resources/db/migration/V121__add_general_education_area.sql deleted file mode 100644 index 9fcabfddc2..0000000000 --- a/src/main/resources/db/migration/V121__add_general_education_area.sql +++ /dev/null @@ -1,7 +0,0 @@ --- 교양 영역 테이블 -CREATE TABLE IF NOT EXISTS `koin`.`general_education_area` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 id', - `name` VARCHAR(20) NOT NULL COMMENT '교양 영역 이름', - PRIMARY KEY(`id`) -) diff --git a/src/main/resources/db/migration/V122__alter_fk_course_type_on_timetable.sql b/src/main/resources/db/migration/V122__alter_fk_course_type_on_timetable.sql deleted file mode 100644 index 5279600076..0000000000 --- a/src/main/resources/db/migration/V122__alter_fk_course_type_on_timetable.sql +++ /dev/null @@ -1,10 +0,0 @@ --- `course_type_id` 컬럼 추가 -ALTER TABLE `timetable_lecture` - ADD COLUMN `course_type_id` INT UNSIGNED DEFAULT NULL COMMENT '이수구분 id'; - --- 외래 키 추가 -ALTER TABLE `timetable_lecture` - ADD CONSTRAINT `FK_COURSE_TYPE_ON_TIMETABLE_LECTURE` - FOREIGN KEY (`course_type_id`) - REFERENCES `course_type` (`id`) - ON DELETE CASCADE; diff --git a/src/main/resources/db/migration/V123__add_catalog.sql b/src/main/resources/db/migration/V123__add_catalog.sql deleted file mode 100644 index f8b4d5689c..0000000000 --- a/src/main/resources/db/migration/V123__add_catalog.sql +++ /dev/null @@ -1,20 +0,0 @@ --- 대학요람 테이블 생성 -CREATE TABLE if not exists `koin`.`catalog` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT comment '고유 id', - `code` VARCHAR(20) NOT NULL comment '강의 코드', - `year` VARCHAR(20) NOT NULL comment '년도', - `lecture_name` VARCHAR(255) NOT NULL comment '강의 이름', - `department_id` INT UNSIGNED NOT NULL comment '학과 id', - `major_id` INT UNSIGNED NULL comment '전공 id', - `general_education_area_id` INT UNSIGNED NULL comment '교양 영역 id', - `credit` INT UNSIGNED NOT NULL DEFAULT 0 comment '학점', - `course_type_id` INT UNSIGNED NOT NULL comment '이수 구분 id', - PRIMARY KEY (`id`), - FOREIGN KEY (`major_id`) REFERENCES `major` (`id`), - FOREIGN KEY (`course_type_id`) REFERENCES `course_type` (`id`), - FOREIGN KEY (`department_id`) REFERENCES `department` (`id`), - FOREIGN KEY (`general_education_area_id`) REFERENCES `general_education_area` (`id`), - created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP comment '생성 일자', - updated_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP comment '수정 일자' -); diff --git a/src/main/resources/db/migration/V124__add_detect_graduation_calculation.sql b/src/main/resources/db/migration/V124__add_detect_graduation_calculation.sql deleted file mode 100644 index 9a948393ac..0000000000 --- a/src/main/resources/db/migration/V124__add_detect_graduation_calculation.sql +++ /dev/null @@ -1,7 +0,0 @@ --- 졸업학점 계산 감지 테이블 -CREATE TABLE if not exists `koin`.`detect_graduation_calculation` -( - id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT comment '고유 id', - user_id INT UNSIGNED NULL comment '유저 id', - is_changed TINYINT(1) NULL DEFAULT 0 comment '졸업학점 계산 변경 여부' -); diff --git a/src/main/resources/db/migration/V125__alter_student_department_fk.sql b/src/main/resources/db/migration/V125__alter_student_department_fk.sql deleted file mode 100644 index 4a1184aecd..0000000000 --- a/src/main/resources/db/migration/V125__alter_student_department_fk.sql +++ /dev/null @@ -1,17 +0,0 @@ --- 1. student 테이블에 department_id 컬럼 추가 -ALTER TABLE students - ADD COLUMN department_id INT UNSIGNED comment '학과 id'; - --- 2. student 테이블의 기존 department 데이터를 department 테이블의 id로 매핑 -UPDATE students s - LEFT JOIN department d ON s.major = d.name - SET s.department_id = d.id; - --- 3. 기존 major 컬럼 삭제 -ALTER TABLE students -DROP COLUMN major; - --- 4. department_id 컬럼을 외래 키로 변경 -ALTER TABLE students - ADD CONSTRAINT fk_student_department - FOREIGN KEY (department_id) REFERENCES department(id); diff --git a/src/main/resources/db/migration/V126__alter_student_add_column_major.sql b/src/main/resources/db/migration/V126__alter_student_add_column_major.sql deleted file mode 100644 index e48ab4f91e..0000000000 --- a/src/main/resources/db/migration/V126__alter_student_add_column_major.sql +++ /dev/null @@ -1,7 +0,0 @@ -ALTER TABLE students - ADD COLUMN major_id INT UNSIGNED; - -ALTER TABLE students - ADD CONSTRAINT fk_student_major - FOREIGN KEY (major_id) REFERENCES major(id) - ON UPDATE CASCADE; diff --git a/src/main/resources/db/migration/V127__alter_fk_general_education_area_id_on_timetable.sql b/src/main/resources/db/migration/V127__alter_fk_general_education_area_id_on_timetable.sql deleted file mode 100644 index 5803fcc103..0000000000 --- a/src/main/resources/db/migration/V127__alter_fk_general_education_area_id_on_timetable.sql +++ /dev/null @@ -1,10 +0,0 @@ --- `general_education_area_id` 컬럼 추가 -ALTER TABLE `timetable_lecture` - ADD COLUMN `general_education_area_id` INT UNSIGNED DEFAULT NULL COMMENT '교양영역 id'; - --- 외래 키 추가 -ALTER TABLE `timetable_lecture` - ADD CONSTRAINT `FK_GENERAL_EDUCATION_AREA_ON_TIMETABLE_LECTURE` - FOREIGN KEY (`general_education_area_id`) - REFERENCES `general_education_area` (`id`) - ON DELETE CASCADE; diff --git a/src/main/resources/db/migration/V128__add_indexes_to_catalog.sql b/src/main/resources/db/migration/V128__add_indexes_to_catalog.sql deleted file mode 100644 index 3039723a8d..0000000000 --- a/src/main/resources/db/migration/V128__add_indexes_to_catalog.sql +++ /dev/null @@ -1,6 +0,0 @@ --- Catalog 테이블에 인덱스 추가 -CREATE INDEX idx_catalog_code_year ON `koin`.`catalog` (code, year); -CREATE INDEX idx_catalog_lecture_name ON `koin`.`catalog` (lecture_name, year); - --- Lecture 테이블에도 인덱스 추가 -CREATE INDEX idx_lecture_code_semester ON `koin`.`lectures`(code, semester_date); diff --git a/src/main/resources/db/migration/V129__update_department_name.sql b/src/main/resources/db/migration/V129__update_department_name.sql deleted file mode 100644 index bbcd3ccccf..0000000000 --- a/src/main/resources/db/migration/V129__update_department_name.sql +++ /dev/null @@ -1 +0,0 @@ -UPDATE `koin`.`department` SET name = "에너지신소재공학부" WHERE name = "에너지신소재화학공학부" diff --git a/src/main/resources/db/migration/V12__alter_menu_categories_update_category_name.sql b/src/main/resources/db/migration/V12__alter_menu_categories_update_category_name.sql deleted file mode 100644 index b8609047bc..0000000000 --- a/src/main/resources/db/migration/V12__alter_menu_categories_update_category_name.sql +++ /dev/null @@ -1,2 +0,0 @@ -update `shop_menu_categories` set name = '추천 메뉴' where name = '이벤트 메뉴'; -update `shop_menu_categories` set name = '메인 메뉴' where name = '대표 메뉴'; diff --git a/src/main/resources/db/migration/V130__delete_major_data.sql b/src/main/resources/db/migration/V130__delete_major_data.sql deleted file mode 100644 index cb9e2454c0..0000000000 --- a/src/main/resources/db/migration/V130__delete_major_data.sql +++ /dev/null @@ -1 +0,0 @@ -DELETE FROM koin.major WHERE id BETWEEN 1 AND 16; diff --git a/src/main/resources/db/migration/V131__update_student_department.sql b/src/main/resources/db/migration/V131__update_student_department.sql deleted file mode 100644 index 95183f3e7b..0000000000 --- a/src/main/resources/db/migration/V131__update_student_department.sql +++ /dev/null @@ -1 +0,0 @@ -UPDATE `koin`.`students` SET department_id = NULL WHERE department_id = 8; diff --git a/src/main/resources/db/migration/V132__alter_major_auto_increment.sql b/src/main/resources/db/migration/V132__alter_major_auto_increment.sql deleted file mode 100644 index 0b0581a037..0000000000 --- a/src/main/resources/db/migration/V132__alter_major_auto_increment.sql +++ /dev/null @@ -1,8 +0,0 @@ -ALTER TABLE koin.major AUTO_INCREMENT = 1; - -ALTER TABLE koin.major - MODIFY COLUMN name VARCHAR(255) NULL COMMENT '전공 이름'; - -ALTER TABLE koin.major - ADD CONSTRAINT `unique_name_department` UNIQUE (`name`, `department_id`); - diff --git a/src/main/resources/db/migration/V133__insert_major_and_department_data.sql b/src/main/resources/db/migration/V133__insert_major_and_department_data.sql deleted file mode 100644 index b3ca6a1133..0000000000 --- a/src/main/resources/db/migration/V133__insert_major_and_department_data.sql +++ /dev/null @@ -1,23 +0,0 @@ -INSERT INTO `koin`.`department` (name) -VALUES ('응용화학공학부'); - -INSERT INTO `koin`.`major` (name, department_id) -VALUES - (null, 1), - (null, 2), - ('생산시스템전공', 3), - ('제어시스템전공', 3), - ('디지털시스템전공', 3), - ('전기공학전공', 4), - ('전자공학전공', 4), - ('정보통신공학전공', 4), - ('디자인공학전공', 5), - ('건축공학전공', 6), - ('화학생명공학전공', 7), - ('에너지신소재공학전공', 8), - ('응용화학공학전공', 12), - ('데이터경영전공', 9), - ('산업경영전공', 9), - ('혁신경영전공', 9), - ('융합경영전공', 9), - (null, 10); diff --git a/src/main/resources/db/migration/V134__alter_lost_item_author_cascade.sql b/src/main/resources/db/migration/V134__alter_lost_item_author_cascade.sql deleted file mode 100644 index 4de4719f32..0000000000 --- a/src/main/resources/db/migration/V134__alter_lost_item_author_cascade.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE `lost_item_articles` -DROP FOREIGN KEY `lost_item_article_author_fk_id`; - -ALTER TABLE `lost_item_articles` -ADD CONSTRAINT `lost_item_article_author_fk_id` FOREIGN KEY (`author_id`) REFERENCES `users` (`id`) ON DELETE SET NULL; diff --git a/src/main/resources/db/migration/V135__update_student_major.sql b/src/main/resources/db/migration/V135__update_student_major.sql deleted file mode 100644 index 3791695fc7..0000000000 --- a/src/main/resources/db/migration/V135__update_student_major.sql +++ /dev/null @@ -1,16 +0,0 @@ -UPDATE `koin`.`students` -SET major_id = CASE - WHEN department_id = 1 THEN 1 - WHEN department_id = 2 THEN 2 - WHEN department_id = 3 THEN 3 - WHEN department_id = 4 THEN 6 - WHEN department_id = 5 THEN 9 - WHEN department_id = 6 THEN 10 - WHEN department_id = 7 THEN 11 - WHEN department_id = 8 THEN 12 - WHEN department_id = 12 THEN 13 - WHEN department_id = 9 THEN 14 - WHEN department_id = 10 THEN 18 - ELSE major_id - END -WHERE department_id IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12); diff --git a/src/main/resources/db/migration/V136__update_coopshop_timatable_25_1.sql b/src/main/resources/db/migration/V136__update_coopshop_timatable_25_1.sql deleted file mode 100644 index 3ddedab7b7..0000000000 --- a/src/main/resources/db/migration/V136__update_coopshop_timatable_25_1.sql +++ /dev/null @@ -1,51 +0,0 @@ -INSERT INTO `coop_semester` (`semester`, `from_date`, `to_date`, `is_applied`) -VALUES ('25-1학기', '2025-03-04', '2025-06-20', 1); - -SET @SEMESTER_ID = LAST_INSERT_ID(); - -INSERT INTO `coop_shop` (`coop_name_id`, `phone`, `location`, `remarks`, `semester_id`) -VALUES (1, '041-560-1278', '학생회관 2층', '천원의 아침밥 평일 운영', @SEMESTER_ID), - (2, '041-560-1778', '복지관 2층', '능수관', @SEMESTER_ID), - (3, '041-560-1779', '복지관 1층', '배달 서비스, 공·일요일 미운영', @SEMESTER_ID), - (4, '041-560-1756', '복지관 1층', '점심시간 12:00 - 13:00', @SEMESTER_ID), - (5, '041-552-1489', '학생회관 2층', NULL, @SEMESTER_ID), - (6, '041-560-1093', '학생회관 2층', '점심시간 11:30 - 12:30', @SEMESTER_ID), - ( 7, '041-560-1093', '복지관 1층, 참빛관 1층', '복지관 임시운영 별도공지', @SEMESTER_ID), - (8, '041-560-1769', '학생회관 1층', '예약제운영', @SEMESTER_ID), - (9, '041-560-1472', '학생회관 1층', NULL, @SEMESTER_ID), - (10, '041-560-1758', '학생회관 1층', '점심시간 14:00 - 15:00', @SEMESTER_ID), - (11, '041-560-1760', '학생회관 1층', '점심시간 12:00 - 13:00', @SEMESTER_ID); - -SET @COOP_SHOP_ID = LAST_INSERT_ID(); - -INSERT INTO coop_opens (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) -VALUES (@COOP_SHOP_ID, '아침', 'WEEKDAYS', '08:00', '09:30'), - (@COOP_SHOP_ID, '점심', 'WEEKDAYS', '11:30', '13:30'), - (@COOP_SHOP_ID, '저녁', 'WEEKDAYS', '17:30', '18:30'), - (@COOP_SHOP_ID, '아침', 'WEEKEND', '조식 미운영', '조식 미운영'), - (@COOP_SHOP_ID, '점심', 'WEEKEND', '11:30', '13:30'), - (@COOP_SHOP_ID, '저녁', 'WEEKEND', '17:30', '18:30'), - (@COOP_SHOP_ID + 1, '점심', 'WEEKDAYS', '11:40', '13:30'), - (@COOP_SHOP_ID + 1, '점심', 'WEEKEND', '미운영', '미운영'), - (@COOP_SHOP_ID + 2, NULL, 'WEEKDAYS', '08:30', '21:00'), - (@COOP_SHOP_ID + 2, NULL, 'SATURDAY', '11:00', '18:30'), - (@COOP_SHOP_ID + 3, NULL, 'WEEKDAYS', '09:00', '18:00'), - (@COOP_SHOP_ID + 3, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 4, NULL, 'WEEKDAYS', '11:30', '18:00'), - (@COOP_SHOP_ID + 4, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 5, NULL, 'WEEKDAYS', '08:30', '18:00'), - (@COOP_SHOP_ID + 5, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 6, NULL, 'WEEKDAYS', '24시간', '24시간'), - (@COOP_SHOP_ID + 6, NULL, 'WEEKEND', '24시간', '24시간'), - (@COOP_SHOP_ID + 7, NULL, 'WEEKDAYS', '09:30', '17:00'), - (@COOP_SHOP_ID + 7, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 8, NULL, 'WEEKDAYS', '24시간', '24시간'), - (@COOP_SHOP_ID + 8, NULL, 'WEEKEND', '24시간', '24시간'), - (@COOP_SHOP_ID + 9, NULL, 'WEEKDAYS', '09:00', '18:00'), - (@COOP_SHOP_ID + 9, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 10, NULL, 'WEEKDAYS', '10:00', '19:00'), - (@COOP_SHOP_ID + 10, NULL, 'WEEKEND', '휴점', '휴점'); - -UPDATE `coop_semester` -SET `is_applied` = 0 -WHERE `semester` = '24-동계방학'; diff --git a/src/main/resources/db/migration/V137__alter_graduation_calculation_unique_cascade.sql b/src/main/resources/db/migration/V137__alter_graduation_calculation_unique_cascade.sql deleted file mode 100644 index 2bd63a5981..0000000000 --- a/src/main/resources/db/migration/V137__alter_graduation_calculation_unique_cascade.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE student_course_calculation - ADD CONSTRAINT unique_user_standard_graduation_requirements UNIQUE (user_id, standard_graduation_requirements_id); - -ALTER TABLE detect_graduation_calculation - ADD CONSTRAINT unique_user UNIQUE (user_id); diff --git a/src/main/resources/db/migration/V138__add_is_deleted_column_to_article_keywords.sql b/src/main/resources/db/migration/V138__add_is_deleted_column_to_article_keywords.sql deleted file mode 100644 index b9c6f798ff..0000000000 --- a/src/main/resources/db/migration/V138__add_is_deleted_column_to_article_keywords.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE `article_keywords` - ADD COLUMN `is_deleted` TINYINT(1) NOT NULL DEFAULT 0; - -ALTER TABLE `article_keyword_user_map` - ADD COLUMN `is_deleted` TINYINT(1) NOT NULL DEFAULT 0; diff --git a/src/main/resources/db/migration/V139__delete_legacy_table_and_column.sql b/src/main/resources/db/migration/V139__delete_legacy_table_and_column.sql deleted file mode 100644 index 8cef26a010..0000000000 --- a/src/main/resources/db/migration/V139__delete_legacy_table_and_column.sql +++ /dev/null @@ -1,9 +0,0 @@ -DROP TABLE IF EXISTS users_owners; -DROP TABLE IF EXISTS koreatech_articles; -DROP TABLE IF EXISTS articles; -DROP TABLE IF EXISTS timetables; - -TRUNCATE TABLE comments; - -ALTER TABLE users DROP COLUMN reset_token; -ALTER TABLE users DROP COLUMN reset_expired_at; diff --git a/src/main/resources/db/migration/V13__add_notification_detail_subscribe_table.sql b/src/main/resources/db/migration/V13__add_notification_detail_subscribe_table.sql deleted file mode 100644 index c9d7508d17..0000000000 --- a/src/main/resources/db/migration/V13__add_notification_detail_subscribe_table.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `notification_subscribe` - ADD COLUMN detail_type VARCHAR(255); diff --git a/src/main/resources/db/migration/V140__add_banner_category_table.sql b/src/main/resources/db/migration/V140__add_banner_category_table.sql deleted file mode 100644 index 6093d5c94e..0000000000 --- a/src/main/resources/db/migration/V140__add_banner_category_table.sql +++ /dev/null @@ -1,12 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`banner_categories` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `name` VARCHAR(255) NOT NULL COMMENT '배너 카테고리 이름', - `description` VARCHAR(255) NOT NULL COMMENT '배너 카테고리 설명', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`) -); - -INSERT INTO `koin`.`banner_categories` (`name`, `description`) -VALUES ('메인 모달', '앱/웹 첫 화면에 뜨는 4:3 (1600x1200) 비율의 배너'); diff --git a/src/main/resources/db/migration/V141__add_banners_table.sql b/src/main/resources/db/migration/V141__add_banners_table.sql deleted file mode 100644 index e6616bbb86..0000000000 --- a/src/main/resources/db/migration/V141__add_banners_table.sql +++ /dev/null @@ -1,18 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`banners` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `title` VARCHAR(255) NOT NULL COMMENT '배너 이름', - `banner_category_id` INT UNSIGNED NOT NULL COMMENT '배너 카테고리 ID', - `priority` INT UNSIGNED NULL COMMENT '배너 우선 순위', - `image_url` VARCHAR(255) NOT NULL COMMENT '배너 이미지 URL', - `web_redirect_link` VARCHAR(255) NULL COMMENT '웹 리다이렉션 URL', - `android_redirect_link` VARCHAR(255) NULL COMMENT '안드로이드 리다이렉션 URL', - `android_minimum_version` VARCHAR(50) NULL COMMENT '안드로이드 최소 버전', - `ios_redirect_link` VARCHAR(255) NULL COMMENT 'IOS 리다이렉션 URL', - `ios_minimum_version` VARCHAR(50) NULL COMMENT 'IOS 최소 버전', - `is_active` TINYINT(1) NOT NULL COMMENT '배너 활성화 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`), - FOREIGN KEY (`banner_category_id`) REFERENCES `koin`.`banner_categories` (`id`) -); diff --git a/src/main/resources/db/migration/V142__add_banner_column_is_release.sql b/src/main/resources/db/migration/V142__add_banner_column_is_release.sql deleted file mode 100644 index 30fb2f2735..0000000000 --- a/src/main/resources/db/migration/V142__add_banner_column_is_release.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE `koin`.`banners` - ADD COLUMN `is_web_released` TINYINT(1) NOT NULL comment '웹 배포 여부' DEFAULT '0', - ADD COLUMN `is_android_released` TINYINT(1) NOT NULL comment '안드로이드 배포 여부' DEFAULT '0', - ADD COLUMN `is_ios_released` TINYINT(1) NOT NULL comment 'IOS 배포 여부' DEFAULT '0'; diff --git a/src/main/resources/db/migration/V143__add_column_user_id.sql b/src/main/resources/db/migration/V143__add_column_user_id.sql deleted file mode 100644 index c23ed5505d..0000000000 --- a/src/main/resources/db/migration/V143__add_column_user_id.sql +++ /dev/null @@ -1,23 +0,0 @@ -ALTER TABLE `users` - ADD COLUMN `user_id` VARCHAR(255) NOT NULL; - -UPDATE `users` -SET `user_id` = SUBSTRING_INDEX(`email`, '@', 1) -WHERE `user_type` IN ('STUDENT', 'ADMIN', 'COUNCIL') - AND `email` IS NOT NULL - AND `id` > 0; - -UPDATE `users` -SET `user_id` = `phone_number` -WHERE `user_type` = 'OWNER' - AND `phone_number` IS NOT NULL - AND `id` > 0; - -UPDATE `users` -SET `user_id` = `email` -WHERE `user_type` = 'COOP' - AND `email` IS NOT NULL - AND `id` > 0; - -ALTER TABLE `users` - ADD CONSTRAINT USER_ID_UNIQUE UNIQUE (`user_id`); diff --git a/src/main/resources/db/migration/V144__add_koin_notice.sql b/src/main/resources/db/migration/V144__add_koin_notice.sql deleted file mode 100644 index 6440766b61..0000000000 --- a/src/main/resources/db/migration/V144__add_koin_notice.sql +++ /dev/null @@ -1,12 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`koin_notice` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `article_id` INT UNSIGNED NOT NULL COMMENT '게시글 고유 ID', - `admin_id` INT UNSIGNED NOT NULL COMMENT '어드민 고유 ID', - `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', - `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', - PRIMARY KEY (`id`), - FOREIGN KEY (`article_id`) REFERENCES `koin`.`new_articles` (`id`), - FOREIGN KEY (`admin_id`) REFERENCES `koin`.`admins` (`user_id`) -) diff --git a/src/main/resources/db/migration/V145__insert_koin_notice_data.sql b/src/main/resources/db/migration/V145__insert_koin_notice_data.sql deleted file mode 100644 index da7ba15af1..0000000000 --- a/src/main/resources/db/migration/V145__insert_koin_notice_data.sql +++ /dev/null @@ -1,18 +0,0 @@ -INSERT INTO koin_notice ( - article_id, - admin_id, - is_deleted, - created_at, - updated_at -) -SELECT - nka.article_id, - nka.user_id, - nka.is_deleted, - nka.created_at, - nka.updated_at -FROM - new_koin_articles nka -INNER JOIN - admins a - ON nka.user_id = a.user_id; diff --git a/src/main/resources/db/migration/V146__delete_koin_notice_in_koin_article.sql b/src/main/resources/db/migration/V146__delete_koin_notice_in_koin_article.sql deleted file mode 100644 index f310a0c316..0000000000 --- a/src/main/resources/db/migration/V146__delete_koin_notice_in_koin_article.sql +++ /dev/null @@ -1,4 +0,0 @@ -DELETE nka -FROM new_koin_articles nka -INNER JOIN admins a ON nka.user_id = a.user_id -WHERE nka.id = nka.id; diff --git a/src/main/resources/db/migration/V147__add_versions_type_isprevious_index.sql b/src/main/resources/db/migration/V147__add_versions_type_isprevious_index.sql deleted file mode 100644 index 85ce9f5b5e..0000000000 --- a/src/main/resources/db/migration/V147__add_versions_type_isprevious_index.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX idx_versions_type_previous ON versions(type, is_previous); diff --git a/src/main/resources/db/migration/V148__add_articles_isdeleted_index.sql b/src/main/resources/db/migration/V148__add_articles_isdeleted_index.sql deleted file mode 100644 index 5e893c7589..0000000000 --- a/src/main/resources/db/migration/V148__add_articles_isdeleted_index.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX idx_articles_is_deleted ON new_articles (is_deleted); diff --git a/src/main/resources/db/migration/V149__remove_phone_number_hyphens.sql b/src/main/resources/db/migration/V149__remove_phone_number_hyphens.sql deleted file mode 100644 index f6e45dcde2..0000000000 --- a/src/main/resources/db/migration/V149__remove_phone_number_hyphens.sql +++ /dev/null @@ -1,3 +0,0 @@ -UPDATE koin.users -SET phone_number = REPLACE(phone_number, '-', '') -WHERE phone_number IS NOT NULL; diff --git a/src/main/resources/db/migration/V14__alter_notification_subscribe_unique.sql b/src/main/resources/db/migration/V14__alter_notification_subscribe_unique.sql deleted file mode 100644 index 529d815d9f..0000000000 --- a/src/main/resources/db/migration/V14__alter_notification_subscribe_unique.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE notification_subscribe - ADD CONSTRAINT unique_user_id_subscribe_type_detail_type - UNIQUE (user_id, subscribe_type, detail_type); diff --git a/src/main/resources/db/migration/V150__add_club_category_table.sql b/src/main/resources/db/migration/V150__add_club_category_table.sql deleted file mode 100644 index 0b7468edb5..0000000000 --- a/src/main/resources/db/migration/V150__add_club_category_table.sql +++ /dev/null @@ -1,14 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`club_category` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `name` VARCHAR(255) NOT NULL COMMENT '동아리 카테고리 이름', - PRIMARY KEY (`id`) -); - -INSERT INTO `koin`.`club_category` (`name`) -VALUES - ('학술'), - ('운동'), - ('취미'), - ('종교'), - ('공연'); diff --git a/src/main/resources/db/migration/V151__add_club_table.sql b/src/main/resources/db/migration/V151__add_club_table.sql deleted file mode 100644 index 69c83551d9..0000000000 --- a/src/main/resources/db/migration/V151__add_club_table.sql +++ /dev/null @@ -1,18 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`club` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `club_category_id` INT UNSIGNED NOT NULL COMMENT '동아리 카테고리 ID', - `name` VARCHAR(50) NOT NULL COMMENT '동아리 이름', - `hits` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '조회수', - `description` VARCHAR(100) NOT NULL COMMENT '동아리 소개', - `is_active` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '활성화 여부', - `image_url` VARCHAR(255) NOT NULL COMMENT '동아리 사진', - `likes` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '동아리 좋아요 개수', - `location` VARCHAR(20) NOT NULL COMMENT '동아리 장소', - `last_week_hits` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '지난 주 조회수', - `introduction` TEXT NOT NULL COMMENT '동아리 상세 소개', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`), - FOREIGN KEY (`club_category_id`) REFERENCES `koin`.`club_category` (`id`) -); diff --git a/src/main/resources/db/migration/V152__add_club_manager.sql b/src/main/resources/db/migration/V152__add_club_manager.sql deleted file mode 100644 index b32123b105..0000000000 --- a/src/main/resources/db/migration/V152__add_club_manager.sql +++ /dev/null @@ -1,9 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`club_manager` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `club_id` INT UNSIGNED NOT NULL COMMENT '동아리 고유 ID', - `user_id` INT UNSIGNED NOT NULL COMMENT '동아리 관리자 유저 ID', - PRIMARY KEY (`id`), - FOREIGN KEY (`club_id`) REFERENCES `koin`.`club` (`id`), - FOREIGN KEY (`user_id`) REFERENCES `koin`.`users` (`id`) ON DELETE CASCADE -); diff --git a/src/main/resources/db/migration/V153__add_club_like.sql b/src/main/resources/db/migration/V153__add_club_like.sql deleted file mode 100644 index 823a7ad970..0000000000 --- a/src/main/resources/db/migration/V153__add_club_like.sql +++ /dev/null @@ -1,11 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`club_like` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `club_id` INT UNSIGNED NOT NULL COMMENT '동아리 고유 ID', - `user_id` INT UNSIGNED NOT NULL COMMENT '유저 ID', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`), - FOREIGN KEY (`club_id`) REFERENCES `koin`.`club` (`id`), - FOREIGN KEY (`user_id`) REFERENCES `koin`.`users` (`id`) ON DELETE CASCADE -); diff --git a/src/main/resources/db/migration/V154__add_club_qna_table.sql b/src/main/resources/db/migration/V154__add_club_qna_table.sql deleted file mode 100644 index ae85ea1e0d..0000000000 --- a/src/main/resources/db/migration/V154__add_club_qna_table.sql +++ /dev/null @@ -1,16 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`club_qna` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `club_id` INT UNSIGNED NOT NULL COMMENT '동아리 고유 ID', - `author_id` INT UNSIGNED NULL COMMENT '작성자 ID', - `parent_id` INT UNSIGNED NULL COMMENT '부모 qna ID', - `content` VARCHAR(255) NOT NULL COMMENT '내용', - `is_deleted` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '삭제 여부', - `is_manager` TINYINT(1) NOT NULL COMMENT '관리자 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`), - FOREIGN KEY (`club_id`) REFERENCES `koin`.`club` (`id`), - FOREIGN KEY (`author_id`) REFERENCES `koin`.`users` (`id`) ON DELETE SET NULL, - FOREIGN KEY (`parent_id`) REFERENCES `koin`.`club_qna` (`id`) -); diff --git a/src/main/resources/db/migration/V155__add_club_hot.sql b/src/main/resources/db/migration/V155__add_club_hot.sql deleted file mode 100644 index c7e4b4ad49..0000000000 --- a/src/main/resources/db/migration/V155__add_club_hot.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`club_hot` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `club_id` INT UNSIGNED NOT NULL COMMENT '인기 동아리 고유 ID', - `ranking` INT UNSIGNED NOT NULL COMMENT '순위', - `period_hits` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '기간 조회수', - `start_date` DATE NOT NULL COMMENT '집계 시작일', - `end_date` DATE NOT NULL COMMENT '집계 종료일', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`), - FOREIGN KEY (`club_id`) REFERENCES `koin`.`club` (`id`) -); diff --git a/src/main/resources/db/migration/V156__add_club_sns_table.sql b/src/main/resources/db/migration/V156__add_club_sns_table.sql deleted file mode 100644 index 3f3f48b843..0000000000 --- a/src/main/resources/db/migration/V156__add_club_sns_table.sql +++ /dev/null @@ -1,9 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`club_sns` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `club_id` INT UNSIGNED NOT NULL COMMENT '동아리 고유 ID', - `sns_type` VARCHAR(50) NOT NULL COMMENT '동아리 SNS 타입', - `contact` VARCHAR(255) NOT NULL COMMENT '동아리 SNS 연락처', - PRIMARY KEY (`id`), - FOREIGN KEY (`club_id`) REFERENCES `koin`.`club` (`id`) -); diff --git a/src/main/resources/db/migration/V157__add_column_is_like_hidden.sql b/src/main/resources/db/migration/V157__add_column_is_like_hidden.sql deleted file mode 100644 index 42b8420d0c..0000000000 --- a/src/main/resources/db/migration/V157__add_column_is_like_hidden.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `koin`.`club` - ADD COLUMN `is_like_hidden` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '좋아요 숨김 여부'; diff --git a/src/main/resources/db/migration/V158__add_oderable_shop.sql b/src/main/resources/db/migration/V158__add_oderable_shop.sql deleted file mode 100644 index a855ea1cde..0000000000 --- a/src/main/resources/db/migration/V158__add_oderable_shop.sql +++ /dev/null @@ -1,18 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`orderable_shop` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `shop_id` INT UNSIGNED NOT NULL UNIQUE COMMENT '상점 ID', - `delivery` tinyint(1) NOT NULL DEFAULT 1 COMMENT '배달 가능 여부', - `takeout` tinyint(1) NOT NULL DEFAULT 1 COMMENT '포장 가능 여부', - `service_event` tinyint(1) NOT NULL DEFAULT 0 COMMENT '서비스 증정 여부', - `minimum_order_amount` INT UNSIGNED NOT NULL COMMENT '최소 주문 금액', - `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`) -); - -CREATE INDEX idx_orderable_shop_shop_id ON orderable_shop (shop_id); -CREATE INDEX idx_orderable_shop_minimum_order_amount ON orderable_shop (minimum_order_amount, shop_id); -CREATE INDEX idx_orderable_shop_filter_01 ON orderable_shop (delivery, takeout, shop_id); -CREATE INDEX idx_orderable_shop_filter_02 ON orderable_shop (minimum_order_amount, delivery, takeout, shop_id); diff --git a/src/main/resources/db/migration/V159__add_index_shop_reviews_rating.sql b/src/main/resources/db/migration/V159__add_index_shop_reviews_rating.sql deleted file mode 100644 index 4a4b2a848b..0000000000 --- a/src/main/resources/db/migration/V159__add_index_shop_reviews_rating.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX shop_reviews_rating ON shop_reviews (shop_id, rating); diff --git a/src/main/resources/db/migration/V15__delete_notification_subscribe.sql b/src/main/resources/db/migration/V15__delete_notification_subscribe.sql deleted file mode 100644 index 304ab64618..0000000000 --- a/src/main/resources/db/migration/V15__delete_notification_subscribe.sql +++ /dev/null @@ -1,16 +0,0 @@ -ALTER TABLE `notification_subscribe` -DROP FOREIGN KEY `FK_NOTIFICATION_SUBSCRIBE_ON_USER`; -ALTER TABLE `notification_subscribe` - ADD CONSTRAINT `FK_NOTIFICATION_SUBSCRIBE_ON_USER` - FOREIGN KEY (`user_id`) - REFERENCES `koin`.`users` (`id`) - ON DELETE CASCADE - ON UPDATE RESTRICT; - -ALTER TABLE `notification` -DROP FOREIGN KEY `FK_NOTIFICATION_ON_USER FOREIGN KEY`; -ALTER TABLE `notification` - ADD CONSTRAINT `FK_NOTIFICATION_ON_USER FOREIGN KEY` - FOREIGN KEY (`users_id`) - REFERENCES `koin`.`users` (`id`) - ON DELETE CASCADE; diff --git a/src/main/resources/db/migration/V160__add_shop_base_delivery_tip.sql b/src/main/resources/db/migration/V160__add_shop_base_delivery_tip.sql deleted file mode 100644 index 7eb526557c..0000000000 --- a/src/main/resources/db/migration/V160__add_shop_base_delivery_tip.sql +++ /dev/null @@ -1,15 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`shop_base_delivery_tip` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `shop_id` INT UNSIGNED NOT NULL COMMENT '상점 ID', - `order_amount` INT NOT NULL COMMENT '주문 금액 기준', - `fee` INT NOT NULL COMMENT '배달비', - `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`) -); - -CREATE INDEX idx_shop_base_delivery_tip_shop_id ON shop_base_delivery_tip (shop_id); -CREATE INDEX idx_shop_base_delivery_tip_01 ON shop_base_delivery_tip (shop_id, order_amount, fee); -CREATE INDEX idx_shop_base_delivery_tip_02 ON shop_base_delivery_tip (shop_id, is_deleted, fee); diff --git a/src/main/resources/db/migration/V161__add_shop_opens_index.sql b/src/main/resources/db/migration/V161__add_shop_opens_index.sql deleted file mode 100644 index 4a84eb18fa..0000000000 --- a/src/main/resources/db/migration/V161__add_shop_opens_index.sql +++ /dev/null @@ -1,2 +0,0 @@ -CREATE INDEX shop_opens_filter ON shop_opens (day_of_week, shop_id, open_time, close_time); -CREATE INDEX shop_opens_shop_id ON shop_opens (shop_id); diff --git a/src/main/resources/db/migration/V162__add_shop_operation.sql b/src/main/resources/db/migration/V162__add_shop_operation.sql deleted file mode 100644 index 35aaf24790..0000000000 --- a/src/main/resources/db/migration/V162__add_shop_operation.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`shop_operation` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `shop_id` INT UNSIGNED NOT NULL UNIQUE COMMENT '상점 ID', - `is_open` tinyint(1) NOT NULL DEFAULT 0 COMMENT '현재 상점 오픈 여부', - `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`) - ); - -CREATE INDEX idx_shop_operation_shop_id ON shop_operation (shop_id); -CREATE INDEX idx_shop_operation_shop_id_is_open ON shop_operation (shop_id, is_open); diff --git a/src/main/resources/db/migration/V163__alter_shops_add_column_introduction_notice.sql b/src/main/resources/db/migration/V163__alter_shops_add_column_introduction_notice.sql deleted file mode 100644 index 1d0e348ca8..0000000000 --- a/src/main/resources/db/migration/V163__alter_shops_add_column_introduction_notice.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE `shops` - ADD COLUMN `introduction` TEXT NULL COMMENT '가게 소개' AFTER `description`, - ADD COLUMN `notice` TEXT NULL COMMENT '가게 알림' AFTER `introduction`; diff --git a/src/main/resources/db/migration/V164__add_shop_menu_origin.sql b/src/main/resources/db/migration/V164__add_shop_menu_origin.sql deleted file mode 100644 index b58bf338cb..0000000000 --- a/src/main/resources/db/migration/V164__add_shop_menu_origin.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`shop_menu_origin` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `shop_id` INT UNSIGNED NOT NULL COMMENT '상점 ID', - `ingredient` TEXT NULL COMMENT '재료 정보', - `origin` TEXT NULL COMMENT '원산지 정보', - `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`) -); - -CREATE INDEX idx_shop_menu_origin_shop_id ON shop_menu_origin (shop_id); diff --git a/src/main/resources/db/migration/V165__update_shop_menu_origin_column_type.sql b/src/main/resources/db/migration/V165__update_shop_menu_origin_column_type.sql deleted file mode 100644 index 8bdb9b020e..0000000000 --- a/src/main/resources/db/migration/V165__update_shop_menu_origin_column_type.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `koin`.`shop_menu_origin` MODIFY COLUMN `ingredient` varchar(50) NULL; -ALTER TABLE `koin`.`shop_menu_origin` MODIFY COLUMN `origin` varchar(50) NULL; diff --git a/src/main/resources/db/migration/V166__add_orderable_shop_menu_group.sql b/src/main/resources/db/migration/V166__add_orderable_shop_menu_group.sql deleted file mode 100644 index b6d6d74663..0000000000 --- a/src/main/resources/db/migration/V166__add_orderable_shop_menu_group.sql +++ /dev/null @@ -1,12 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`orderable_shop_menu_group` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `orderable_shop_id` INT UNSIGNED NOT NULL COMMENT '주문 가능 상점 ID', - `name` VARCHAR(255) NOT NULL COMMENT '메뉴 그룹 이름', - `is_deleted` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`) -); - -CREATE INDEX idx_orderable_shop_id ON `koin`.`orderable_shop_menu_group` (orderable_shop_id); diff --git a/src/main/resources/db/migration/V167__add_orderable_shop_menu.sql b/src/main/resources/db/migration/V167__add_orderable_shop_menu.sql deleted file mode 100644 index a5b0db648f..0000000000 --- a/src/main/resources/db/migration/V167__add_orderable_shop_menu.sql +++ /dev/null @@ -1,14 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`orderable_shop_menu` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `orderable_shop_id` INT UNSIGNED NOT NULL COMMENT '주문 가능한 상점 ID', - `name` VARCHAR(255) NOT NULL COMMENT '메뉴 이름', - `description` TEXT NULL COMMENT '메뉴 설명', - `is_sold_out` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '품절 여부', - `is_deleted` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`) -); - -CREATE INDEX idx_orderable_shop_menu_orderable_shop_id ON `koin`.`orderable_shop_menu` (orderable_shop_id); diff --git a/src/main/resources/db/migration/V168__add_orderable_shop_menu_group_map.sql b/src/main/resources/db/migration/V168__add_orderable_shop_menu_group_map.sql deleted file mode 100644 index 47bda76faa..0000000000 --- a/src/main/resources/db/migration/V168__add_orderable_shop_menu_group_map.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`orderable_shop_menu_group_map` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `orderable_shop_menu_group_id` INT UNSIGNED NOT NULL COMMENT '주문 가능 메뉴 그룹 ID', - `orderable_shop_menu_id` INT UNSIGNED NOT NULL COMMENT '주문 가능 메뉴 ID', - `is_deleted` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`) -); - -CREATE INDEX idx_map_on_menu_group_id ON `koin`.`orderable_shop_menu_group_map` (orderable_shop_menu_group_id); -CREATE INDEX idx_map_on_menu_id ON `koin`.`orderable_shop_menu_group_map` (orderable_shop_menu_id); diff --git a/src/main/resources/db/migration/V169__add_orderable_shop_menu_price.sql b/src/main/resources/db/migration/V169__add_orderable_shop_menu_price.sql deleted file mode 100644 index b0fd421862..0000000000 --- a/src/main/resources/db/migration/V169__add_orderable_shop_menu_price.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`orderable_shop_menu_price` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `orderable_shop_menu_id` INT UNSIGNED NOT NULL COMMENT '메뉴 ID', - `name` VARCHAR(255) NULL COMMENT '가격 옵션 이름 (ex: 대, 중, 소)', - `price` INT UNSIGNED NOT NULL COMMENT '가격', - `is_deleted` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`) -); - -CREATE INDEX idx_price_on_menu_id ON `koin`.`orderable_shop_menu_price` (orderable_shop_menu_id); diff --git a/src/main/resources/db/migration/V16__add_account_column_to_owners_table.sql b/src/main/resources/db/migration/V16__add_account_column_to_owners_table.sql deleted file mode 100644 index 1aa2951813..0000000000 --- a/src/main/resources/db/migration/V16__add_account_column_to_owners_table.sql +++ /dev/null @@ -1,7 +0,0 @@ -ALTER TABLE `koin`.`owners` - ADD COLUMN `account` VARCHAR(255) NULL COMMENT '사장님 전화번호(“-“ 제거, unique)', - ADD UNIQUE INDEX `account_UNIQUE` (`account`); - -UPDATE `koin`.`owners` o - JOIN `koin`.`users` u ON o.user_id = u.id - SET o.account = REPLACE(u.phone_number, '-', '') diff --git a/src/main/resources/db/migration/V170__add_orderable_shop_menu_images.sql b/src/main/resources/db/migration/V170__add_orderable_shop_menu_images.sql deleted file mode 100644 index 14471fc88c..0000000000 --- a/src/main/resources/db/migration/V170__add_orderable_shop_menu_images.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`orderable_shop_menu_images` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `orderable_shop_menu_id` INT UNSIGNED NOT NULL COMMENT '주문 가능 메뉴 ID', - `image_url` VARCHAR(255) NOT NULL COMMENT '이미지 URL', - `is_thumbnail` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '대표 이미지 여부', - `is_deleted` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`) -); - -CREATE INDEX idx_images_on_menu_id ON `koin`.`orderable_shop_menu_images` (orderable_shop_menu_id); diff --git a/src/main/resources/db/migration/V171__add_orderable_shop_menu_option_group.sql b/src/main/resources/db/migration/V171__add_orderable_shop_menu_option_group.sql deleted file mode 100644 index 50e5543511..0000000000 --- a/src/main/resources/db/migration/V171__add_orderable_shop_menu_option_group.sql +++ /dev/null @@ -1,16 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`orderable_shop_menu_option_group` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `orderable_shop_id` INT UNSIGNED NOT NULL COMMENT '주문 가능한 상점 ID', - `name` VARCHAR(255) NOT NULL COMMENT '옵션 그룹 이름 (ex: 맛, 음료 등)', - `description` TEXT NULL COMMENT '옵션 그룹 설명', - `is_required` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '필수 옵션 여부', - `min_select` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '최소 선택 개수', - `max_select` INT UNSIGNED NULL DEFAULT NULL COMMENT '최대 선택 개수', - `is_deleted` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`) -); - -CREATE INDEX idx_orderable_shop_id ON `koin`.`orderable_shop_menu_option_group` (orderable_shop_id); diff --git a/src/main/resources/db/migration/V172__add_orderable_shop_menu_option_group_map.sql b/src/main/resources/db/migration/V172__add_orderable_shop_menu_option_group_map.sql deleted file mode 100644 index b1c6bea04c..0000000000 --- a/src/main/resources/db/migration/V172__add_orderable_shop_menu_option_group_map.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`orderable_shop_menu_option_group_map` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `orderable_shop_menu_option_group_id` INT UNSIGNED NOT NULL COMMENT '옵션 그룹 ID', - `orderable_shop_menu_id` INT UNSIGNED NOT NULL COMMENT '메뉴 ID', - `is_deleted` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`) -); - -CREATE INDEX idx_map_on_option_group_id ON `koin`.`orderable_shop_menu_option_group_map` (orderable_shop_menu_option_group_id); -CREATE INDEX idx_map_on_menu_id ON `koin`.`orderable_shop_menu_option_group_map` (orderable_shop_menu_id); diff --git a/src/main/resources/db/migration/V173__add_orderable_shop_menu_option.sql b/src/main/resources/db/migration/V173__add_orderable_shop_menu_option.sql deleted file mode 100644 index d9aa0ee7df..0000000000 --- a/src/main/resources/db/migration/V173__add_orderable_shop_menu_option.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`orderable_shop_menu_option` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `orderable_shop_menu_option_group_id` INT UNSIGNED NOT NULL COMMENT '옵션 그룹 ID', - `name` VARCHAR(255) NOT NULL COMMENT '옵션 이름 (ex: 순한맛, 콜라)', - `price` INT UNSIGNED NOT NULL COMMENT '추가 가격', - `is_deleted` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`) -); - -CREATE INDEX idx_option_on_option_group_id ON `koin`.`orderable_shop_menu_option` (orderable_shop_menu_option_group_id); diff --git a/src/main/resources/db/migration/V174__update_coopshop_timatable_25_summer.sql b/src/main/resources/db/migration/V174__update_coopshop_timatable_25_summer.sql deleted file mode 100644 index ce1cc4c2db..0000000000 --- a/src/main/resources/db/migration/V174__update_coopshop_timatable_25_summer.sql +++ /dev/null @@ -1,52 +0,0 @@ -INSERT INTO `koin`.`coop_semester` (`semester`, `from_date`, `to_date`, `is_applied`) -VALUES ('25-하계방학', '2025-06-23', '2025-08-31', 1); - -SET @SEMESTER_ID = LAST_INSERT_ID(); - -INSERT INTO `koin`.`coop_shop` (`coop_name_id`, `phone`, `location`, `remarks`, `semester_id`) -VALUES (1, '041-560-1278', '학생회관 2층', '비계절학기 토/일 미운영', @SEMESTER_ID), - (2, '041-560-1778', '복지관 2층', '능수관, 계절학기까지 운영', @SEMESTER_ID), - (3, '041-560-1779', '복지관 1층', NULL, @SEMESTER_ID), - (4, '041-560-1756', '복지관 1층', NULL, @SEMESTER_ID), - (5, '041-552-1763', '학생회관 2층', '점심시간 12:00 - 13:00', @SEMESTER_ID), - (6, '041-560-1093', '학생회관 2층', '점심시간 11:30 - 12:30', @SEMESTER_ID), - (7, '041-560-1279', '복지관 1층, 참빛관 1층', NULL, @SEMESTER_ID), - (8, '041-560-1372', '학생회관 1층', NULL, @SEMESTER_ID), - (9, '041-560-1472', '학생회관 1층', NULL, @SEMESTER_ID), - (10, '041-560-1758', '학생회관 1층', '점심시간 12:00 - 13:00', @SEMESTER_ID), - (11, '041-560-1760', '학생회관 1층', '점심시간 13:00 - 14:00', @SEMESTER_ID); - -SET @COOP_SHOP_ID = LAST_INSERT_ID(); - -INSERT INTO `koin`.`coop_opens` (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) -VALUES (@COOP_SHOP_ID, '아침', 'WEEKDAYS', '08:00', '09:00'), - (@COOP_SHOP_ID, '점심', 'WEEKDAYS', '11:30', '13:30'), - (@COOP_SHOP_ID, '저녁', 'WEEKDAYS', '17:30', '18:30'), - (@COOP_SHOP_ID, '아침', 'WEEKEND', '08:00', '09:00'), - (@COOP_SHOP_ID, '점심', 'WEEKEND', '11:30', '13:30'), - (@COOP_SHOP_ID, '저녁', 'WEEKEND', '17:30', '18:30'), - (@COOP_SHOP_ID + 1, '점심', 'WEEKDAYS', '11:40', '13:30'), - (@COOP_SHOP_ID + 1, '점심', 'WEEKEND', '미운영', '미운영'), - (@COOP_SHOP_ID + 2, NULL, 'WEEKDAYS', '08:30', '20:00'), - (@COOP_SHOP_ID + 2, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 3, NULL, 'WEEKDAYS', '09:00', '18:00'), - (@COOP_SHOP_ID + 3, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 4, NULL, 'WEEKDAYS', '10:30', '16:00'), - (@COOP_SHOP_ID + 4, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 5, NULL, 'WEEKDAYS', '10:00', '16:00'), - (@COOP_SHOP_ID + 5, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 6, NULL, 'WEEKDAYS', '24시간', '24시간'), - (@COOP_SHOP_ID + 6, NULL, 'WEEKEND', '24시간', '24시간'), - (@COOP_SHOP_ID + 7, NULL, 'WEEKDAYS', '10:00', '16:00'), - (@COOP_SHOP_ID + 7, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 8, NULL, 'WEEKDAYS', '24시간', '24시간'), - (@COOP_SHOP_ID + 8, NULL, 'WEEKEND', '24시간', '24시간'), - (@COOP_SHOP_ID + 9, NULL, 'WEEKDAYS', '09:00', '18:00'), - (@COOP_SHOP_ID + 9, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 10, NULL, 'WEEKDAYS', '11:00', '17:00'), - (@COOP_SHOP_ID + 10, NULL, 'FRIDAY', '휴점', '휴점'), - (@COOP_SHOP_ID + 10, NULL, 'WEEKEND', '휴점', '휴점'); - -UPDATE `koin`.`coop_semester` -SET `is_applied` = 0 -WHERE `semester` = '25-1학기'; diff --git a/src/main/resources/db/migration/V175__alter_versions_shuttle.sql b/src/main/resources/db/migration/V175__alter_versions_shuttle.sql deleted file mode 100644 index d75da68edd..0000000000 --- a/src/main/resources/db/migration/V175__alter_versions_shuttle.sql +++ /dev/null @@ -1,4 +0,0 @@ -UPDATE versions -SET title = '계절학기', - content = '2025-06-21~2025-07-15' -WHERE type = 'shuttle_bus_timetable'; diff --git a/src/main/resources/db/migration/V176__add_cart.sql b/src/main/resources/db/migration/V176__add_cart.sql deleted file mode 100644 index 49f2d8ea46..0000000000 --- a/src/main/resources/db/migration/V176__add_cart.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`cart` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `user_id` INT UNSIGNED NOT NULL COMMENT '사용자 ID', - `orderable_shop_id` INT UNSIGNED NOT NULL COMMENT '주문 가능 상점 ID', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`), - UNIQUE KEY `uk_user_orderable_shop` (`user_id`, `orderable_shop_id`) -); - -CREATE INDEX idx_user_id_orderable_shop_id ON `koin`.`cart` (user_id, orderable_shop_id); -CREATE INDEX idx_orderable_shop_id ON `koin`.`cart` (orderable_shop_id); diff --git a/src/main/resources/db/migration/V177__add_cart_menu_item.sql b/src/main/resources/db/migration/V177__add_cart_menu_item.sql deleted file mode 100644 index eb7b787f9a..0000000000 --- a/src/main/resources/db/migration/V177__add_cart_menu_item.sql +++ /dev/null @@ -1,14 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`cart_menu_item` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `cart_id` INT UNSIGNED NOT NULL COMMENT '장바구니 ID', - `orderable_shop_menu_id` INT UNSIGNED NOT NULL COMMENT '상점 메뉴 ID', - `orderable_shop_menu_price_id` INT UNSIGNED NOT NULL COMMENT '상점 메뉴 가격 ID', - `quantity` INT UNSIGNED NOT NULL COMMENT '메뉴 수량', - `is_modified` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '메뉴 정보 변경 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`) -); - -CREATE INDEX idx_cart_id ON `koin`.`cart_menu_item` (cart_id, orderable_shop_menu_id, orderable_shop_menu_price_id); diff --git a/src/main/resources/db/migration/V178__add_cart_menu_item_option.sql b/src/main/resources/db/migration/V178__add_cart_menu_item_option.sql deleted file mode 100644 index 1cbfa897ef..0000000000 --- a/src/main/resources/db/migration/V178__add_cart_menu_item_option.sql +++ /dev/null @@ -1,15 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`cart_menu_item_option` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `cart_menu_item_id` INT UNSIGNED NOT NULL COMMENT '장바구니 메뉴 ID', - `orderable_shop_menu_option_id` INT UNSIGNED NOT NULL COMMENT '상점 메뉴 옵션 ID', - `option_name` VARCHAR(255) NOT NULL COMMENT '옵션 이름', - `option_price` INT UNSIGNED NOT NULL COMMENT '옵션 가격', - `quantity` INT UNSIGNED NOT NULL COMMENT '옵션 수량', - `is_modified` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '옵션 정보 변경 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`) -); - -CREATE INDEX idx_cart_menu_item_id ON `koin`.`cart_menu_item_option` (cart_menu_item_id, orderable_shop_menu_option_id); diff --git a/src/main/resources/db/migration/V179__add_order.sql b/src/main/resources/db/migration/V179__add_order.sql deleted file mode 100644 index d2d2519b7e..0000000000 --- a/src/main/resources/db/migration/V179__add_order.sql +++ /dev/null @@ -1,17 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`order` -( - `id` VARCHAR(64) NOT NULL COMMENT '주문 ID', - - `order_type` VARCHAR(10) NOT NULL COMMENT '주문 타입', - `phone_number` VARCHAR(20) NOT NULL COMMENT '주문자 전화번호', - `total_product_price` INT UNSIGNED COMMENT '상품 총 금액', - `total_price` INT UNSIGNED COMMENT '주문 총 금액', - `is_deleted` TINYINT(1) NOT NULL DEFAULT FALSE COMMENT '삭제 여부', - `orderable_shop_id` INT UNSIGNED COMMENT '주문한 상점 ID', - `user_id` INT UNSIGNED COMMENT '주문자 사용자 ID', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', - PRIMARY KEY (`id`), - CONSTRAINT `fk_order_shop` FOREIGN KEY (`orderable_shop_id`) REFERENCES `koin`.`orderable_shop` (`id`), - CONSTRAINT `fk_order_user` FOREIGN KEY (`user_id`) REFERENCES `koin`.`users` (`id`) -); diff --git a/src/main/resources/db/migration/V17__create_coop_table_and_insert_data.sql b/src/main/resources/db/migration/V17__create_coop_table_and_insert_data.sql deleted file mode 100644 index 1641445c19..0000000000 --- a/src/main/resources/db/migration/V17__create_coop_table_and_insert_data.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE IF NOT EXISTS `coop` -( - `user_id` INT UNSIGNED NOT NULL COMMENT '유저 id, user_type COOP으로 가져옴', - `coop_id` VARCHAR(255) COMMENT '영양사 id, 일반 로그인 형식', - PRIMARY KEY (`user_id`), - CONSTRAINT `FK_COOP_ON_USER` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT -); - -INSERT INTO `coop` (`user_id`, `coop_id`) - SELECT `id`, '' FROM `users` WHERE `user_type` = 'COOP'; diff --git a/src/main/resources/db/migration/V180__add_order_delivery.sql b/src/main/resources/db/migration/V180__add_order_delivery.sql deleted file mode 100644 index 87ac822ac2..0000000000 --- a/src/main/resources/db/migration/V180__add_order_delivery.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`order_delivery` -( - `order_id` VARCHAR(64) NOT NULL COMMENT '주문 ID', - `address` VARCHAR(100) NOT NULL COMMENT '배달 주소', - `to_owner` VARCHAR(50) NOT NULL COMMENT '사장님 전달 메시지', - `to_rider` VARCHAR(50) NOT NULL COMMENT '라이더 전달 메시지', - `delivery_tip` INT UNSIGNED NOT NULL COMMENT '배달비', - PRIMARY KEY (order_id), - CONSTRAINT `fk_order_delivery_order` FOREIGN KEY (`order_id`) REFERENCES `koin`.`order` (`id`) -); diff --git a/src/main/resources/db/migration/V181__add_order_takeout.sql b/src/main/resources/db/migration/V181__add_order_takeout.sql deleted file mode 100644 index f89f58759a..0000000000 --- a/src/main/resources/db/migration/V181__add_order_takeout.sql +++ /dev/null @@ -1,7 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`order_takeout` -( - `order_id` VARCHAR(64) NOT NULL COMMENT '주문 ID', - `to_owner` VARCHAR(50) NOT NULL COMMENT '사장님 전달 메시지', - PRIMARY KEY (order_id), - CONSTRAINT `fk_order_pack_order` FOREIGN KEY (`order_id`) REFERENCES `koin`.`order` (`id`) -); diff --git a/src/main/resources/db/migration/V182__add_payment.sql b/src/main/resources/db/migration/V182__add_payment.sql deleted file mode 100644 index 94ca23049c..0000000000 --- a/src/main/resources/db/migration/V182__add_payment.sql +++ /dev/null @@ -1,14 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`payment` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `payment_key` VARCHAR(200) NOT NULL COMMENT '결제 키', - `amount` INT UNSIGNED NOT NULL COMMENT '결제 금액', - `status` VARCHAR(30) NOT NULL COMMENT '결제 상태', - `method` VARCHAR(30) NOT NULL COMMENT '결제 수단', - `requested_at` TIMESTAMP NOT NULL COMMENT '결제 요청 일시', - `approved_at` TIMESTAMP NOT NULL COMMENT '결제 승인 일시', - `order_id` VARCHAR(64) NOT NULL COMMENT '주문 번호', - PRIMARY KEY (`id`), - UNIQUE KEY uq_payment_key (`id`), - CONSTRAINT fk_payment_order FOREIGN KEY (`order_id`) REFERENCES `koin`.`order` (`id`) -); diff --git a/src/main/resources/db/migration/V183__add_payment_cancel.sql b/src/main/resources/db/migration/V183__add_payment_cancel.sql deleted file mode 100644 index 83fb275262..0000000000 --- a/src/main/resources/db/migration/V183__add_payment_cancel.sql +++ /dev/null @@ -1,11 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`payment_cancel` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '결제 취소 ID', - `transaction_key` VARCHAR(64) NOT NULL COMMENT '취소 트랜잭션 키', - `cancel_reason` VARCHAR(200) NOT NULL COMMENT '취소 사유', - `cancel_amount` INT UNSIGNED NOT NULL COMMENT '취소 금액', - `canceled_at` TIMESTAMP NOT NULL COMMENT '취소 일시', - `payment_id` INT UNSIGNED NOT NULL COMMENT '결제 ID', - PRIMARY KEY (`id`), - CONSTRAINT `fk_payment_cancel_payment` FOREIGN KEY (`payment_id`) REFERENCES `koin`.`payment` (`id`) -); diff --git a/src/main/resources/db/migration/V184__add_order_menu.sql b/src/main/resources/db/migration/V184__add_order_menu.sql deleted file mode 100644 index cdf3003d63..0000000000 --- a/src/main/resources/db/migration/V184__add_order_menu.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`order_menu` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '주문 메뉴 ID', - `menu_name` VARCHAR(255) NOT NULL COMMENT '메뉴 이름', - `menu_price` INT UNSIGNED NOT NULL COMMENT '메뉴 금액', - `quantity` INT UNSIGNED NOT NULL COMMENT '수량', - `order_id` VARCHAR(64) NOT NULL COMMENT '주문 ID', - PRIMARY KEY (`id`), - CONSTRAINT `fk_order_menu_order` FOREIGN KEY (`order_id`) REFERENCES `koin`.`order` (`id`) -); diff --git a/src/main/resources/db/migration/V185__add_order_menu_option.sql b/src/main/resources/db/migration/V185__add_order_menu_option.sql deleted file mode 100644 index a860a915ad..0000000000 --- a/src/main/resources/db/migration/V185__add_order_menu_option.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`order_menu_option` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '메뉴 옵션 ID', - `option_name` VARCHAR(255) NOT NULL COMMENT '옵션 이름', - `option_price` INT UNSIGNED NOT NULL COMMENT '옵션 가격', - `quantity` INT UNSIGNED NOT NULL COMMENT '옵션 수량', - `order_menu_id` INT UNSIGNED NOT NULL COMMENT '주문 메뉴 ID', - PRIMARY KEY (`id`), - CONSTRAINT `fk_order_menu_option_menu` FOREIGN KEY (`order_menu_id`) REFERENCES `koin`.`order_menu` (`id`) -); diff --git a/src/main/resources/db/migration/V186__add_articles_deleted_notice_index.sql b/src/main/resources/db/migration/V186__add_articles_deleted_notice_index.sql deleted file mode 100644 index 1b70270196..0000000000 --- a/src/main/resources/db/migration/V186__add_articles_deleted_notice_index.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP INDEX idx_articles_is_deleted ON new_articles; -CREATE INDEX idx_articles_deleted_notice ON new_articles (is_deleted, is_notice); diff --git a/src/main/resources/db/migration/V187__add_menu_option_name_to_order_menu.sql b/src/main/resources/db/migration/V187__add_menu_option_name_to_order_menu.sql deleted file mode 100644 index d11912083d..0000000000 --- a/src/main/resources/db/migration/V187__add_menu_option_name_to_order_menu.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `koin`.`order_menu` - ADD COLUMN menu_option_name VARCHAR(255) NOT NULL COMMENT '메뉴 옵션 이름' AFTER menu_name; diff --git a/src/main/resources/db/migration/V188__add_campus_delivery_address_type_table.sql b/src/main/resources/db/migration/V188__add_campus_delivery_address_type_table.sql deleted file mode 100644 index 1647119a12..0000000000 --- a/src/main/resources/db/migration/V188__add_campus_delivery_address_type_table.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`campus_delivery_address_type` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '교내 주소 타입 ID', - `name` VARCHAR(255) NOT NULL COMMENT '교내 주소 타입 이름', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`) -); - -INSERT INTO `koin`.`campus_delivery_address_type` (`name`) VALUES ('기숙사'), ('공학관'), ('그 외'); diff --git a/src/main/resources/db/migration/V189__add_campus_delivery_address_table.sql b/src/main/resources/db/migration/V189__add_campus_delivery_address_table.sql deleted file mode 100644 index f68ecf1236..0000000000 --- a/src/main/resources/db/migration/V189__add_campus_delivery_address_table.sql +++ /dev/null @@ -1,36 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`campus_delivery_address` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '교내 배달 주소 ID', - `campus_address_type_id` INT UNSIGNED NOT NULL COMMENT '교내 배달 주소 타입 ID', - `full_address` VARCHAR(255) NOT NULL COMMENT '교내 배달 전체 주소', - `short_address` VARCHAR(50) NOT NULL COMMENT '교내 배달 요약 주소', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`) -); - -CREATE INDEX idx_campus_delivery_address ON `koin`.`campus_delivery_address` (campus_address_type_id); - -INSERT INTO `koin`.`campus_delivery_address` (`campus_address_type_id`, `full_address`, `short_address`) -VALUES (1, '충남 천안시 동남구 병천면 충절로 1600 한국기술교육대학교 제1캠퍼스 생활관 101동', '101동(해울)'), - (1, '충남 천안시 동남구 병천면 충절로 1600 한국기술교육대학교 제1캠퍼스 생활관 102동', '102동(예지)'), - (1, '충남 천안시 동남구 병천면 충절로 1600 한국기술교육대학교 제1캠퍼스 생활관 103동', '103동(예솔)'), - (1, '충남 천안시 동남구 병천면 충절로 1600 한국기술교육대학교 제1캠퍼스 생활관 104동', '104동(다솔)'), - (1, '충남 천안시 동남구 병천면 충절로 1600 한국기술교육대학교 제1캠퍼스 생활관 105동', '105동(함지)'), - (1, '충남 천안시 동남구 병천면 충절로 1600 한국기술교육대학교 제1캠퍼스 생활관 106동', '106동(한울)'), - (1, '충남 천안시 동남구 병천면 충절로 1600 한국기술교육대학교 제1캠퍼스 생활관 201동', '201동(솔빛)'), - (1, '충남 천안시 동남구 병천면 충절로 1600 한국기술교육대학교 제1캠퍼스 생활관 202동', '202동(청솔)'), - (1, '충남 천안시 동남구 병천면 충절로 1600 한국기술교육대학교 제1캠퍼스 생활관 203동', '203동(IH)'), - (1, '충남 천안시 동남구 병천면 충절로 1600 한국기술교육대학교 제1캠퍼스 생활관 204동', '204동(은솔)'), - (1, '충남 천안시 동남구 병천면 충절로 1600 한국기술교육대학교 제1캠퍼스 생활관 205동', '205동(참빛)'), - (2, '충남 천안시 동남구 병천면 충절로 1600 한국기술교육대학교 공학 1관', '공학 1관'), - (2, '충남 천안시 동남구 병천면 충절로 1600 한국기술교육대학교 공학 2관', '공학 2관'), - (2, '충남 천안시 동남구 병천면 충절로 1600 한국기술교육대학교 공학 3관', '공학 3관'), - (2, '충남 천안시 동남구 병천면 충절로 1600 한국기술교육대학교 공학4관 A동', '공학4관 A동'), - (2, '충남 천안시 동남구 병천면 충절로 1600 한국기술교육대학교 공학4관 B동', '공학4관 B동'), - (2, '충남 천안시 동남구 병천면 충절로 1600 한국기술교육대학교 담헌실학관', '담헌실학관'), - (2, '충남 천안시 동남구 병천면 충절로 1600 한국기술교육대학교 인문경영관', '인문경영관'), - (3, '충남 천안시 동남구 병천면 충절로 1600 한국기술교육대학교 테니스장', '테니스장'), - (3, '충남 천안시 동남구 병천면 충절로 1600 한국기술교육대학교 학생회관', '학생회관'), - (3, '충남 천안시 동남구 병천면 충절로 1600 한국기술교육대학교 다산정보관', '다산정보관'), - (3, '충남 천안시 동남구 병천면 충절로 1600 한국기술교육대학교 복지관', '복지관'); diff --git a/src/main/resources/db/migration/V18__alter_user_email_column_nullable.sql b/src/main/resources/db/migration/V18__alter_user_email_column_nullable.sql deleted file mode 100644 index 822306bdd7..0000000000 --- a/src/main/resources/db/migration/V18__alter_user_email_column_nullable.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `koin`.`users` - CHANGE COLUMN `email` `email` VARCHAR(100) CHARACTER SET 'utf8mb3' NULL COMMENT '학교 email' ; diff --git a/src/main/resources/db/migration/V190__add_orderable_shop_delivery_option_table.sql b/src/main/resources/db/migration/V190__add_orderable_shop_delivery_option_table.sql deleted file mode 100644 index 4bb289640a..0000000000 --- a/src/main/resources/db/migration/V190__add_orderable_shop_delivery_option_table.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`orderable_shop_delivery_option` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID', - `orderable_shop_id` INT UNSIGNED NOT NULL COMMENT '주문 가능 상점 ID', - `campus_delivery` tinyint(1) NOT NULL DEFAULT 1 COMMENT '교내 배달 가능 여부', - `off_campus_delivery` tinyint(1) NOT NULL DEFAULT 1 COMMENT '교외 배달 가능 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`) -); diff --git a/src/main/resources/db/migration/V191__add_user_delivery_address_table.sql b/src/main/resources/db/migration/V191__add_user_delivery_address_table.sql deleted file mode 100644 index 3d00f330cb..0000000000 --- a/src/main/resources/db/migration/V191__add_user_delivery_address_table.sql +++ /dev/null @@ -1,30 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`user_delivery_address` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '배달 주소 고유 ID', - `user_id` INT UNSIGNED NOT NULL COMMENT '사용자 ID', - `address_type` VARCHAR(20) NOT NULL COMMENT '주소 타입 (CAMPUS, OFF_CAMPUS)', - - -- 교내 주소용 필드 - `campus_delivery_address_id` INT UNSIGNED NULL COMMENT '교내 배달 주소 ID', - - -- 교외 주소용 필드 - `zip_number` VARCHAR(10) NULL COMMENT '교외 배달 주소 우편 번호', - `si_do` VARCHAR(50) NULL COMMENT '시/도', - `si_gun_gu` VARCHAR(50) NULL COMMENT '시/군/구', - `eup_myeon_dong` VARCHAR(50) NULL COMMENT '읍/면/동', - `road` VARCHAR(50) NULL COMMENT '도로명', - `building` VARCHAR(50) NULL COMMENT '건물명', - `detail_address` VARCHAR(100) NULL COMMENT '상세 주소', - `full_address` VARCHAR(255) NULL COMMENT '전체 주소 (도로명/지번)', - - -- 사용 추적 - `last_used_at` TIMESTAMP NULL COMMENT '마지막 사용 시간', - `usage_count` INT UNSIGNED DEFAULT 0 COMMENT '사용 횟수', - `is_default` tinyint(1) DEFAULT 0, - - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`) -); - -CREATE INDEX idx_user_address ON `koin`.`user_delivery_address` (user_id); diff --git a/src/main/resources/db/migration/V192__add_rider_message_table.sql b/src/main/resources/db/migration/V192__add_rider_message_table.sql deleted file mode 100644 index 83cb378fd9..0000000000 --- a/src/main/resources/db/migration/V192__add_rider_message_table.sql +++ /dev/null @@ -1,16 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`rider_message` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '배달 기사 요청 사항 고유 ID', - `content` VARCHAR(100) NOT NULL COMMENT '배달 기사 요청 사항', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`) -); - -INSERT INTO `koin`.`rider_message` (`content`) -VALUES ('문 앞에 놔주세요 (벨 눌러주세요)'), - ('문 앞에 놔주세요 (노크해주세요)'), - ('문 앞에 놔주세요 (벨X, 노크 X)'), - ('직접 받을게요'), - ('전화주시면 마중 나갈게요'); - diff --git a/src/main/resources/db/migration/V193__add_orderable_shop_image_table.sql b/src/main/resources/db/migration/V193__add_orderable_shop_image_table.sql deleted file mode 100644 index fd53181ff1..0000000000 --- a/src/main/resources/db/migration/V193__add_orderable_shop_image_table.sql +++ /dev/null @@ -1,14 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`orderable_shop_image` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `orderable_shop_id` INT UNSIGNED NOT NULL COMMENT '주문 가능 상점 ID', - `image_url` VARCHAR(255) NOT NULL COMMENT '이미지 URL', - `is_thumbnail` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '대표 이미지 여부', - `is_deleted` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - PRIMARY KEY (`id`) -); - -CREATE INDEX idx_images_on_orderable_shop_id ON `koin`.`orderable_shop_image` (orderable_shop_id); -CREATE INDEX idx_thumbnail_images ON `koin`.`orderable_shop_image` (orderable_shop_id, is_thumbnail); diff --git a/src/main/resources/db/migration/V194__add_club_recruitment.sql b/src/main/resources/db/migration/V194__add_club_recruitment.sql deleted file mode 100644 index 40e2f80c32..0000000000 --- a/src/main/resources/db/migration/V194__add_club_recruitment.sql +++ /dev/null @@ -1,15 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`club_recruitment` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '동아리 모집 고유 ID', - `club_id` INT UNSIGNED NOT NULL COMMENT '동아리 고유 ID', - `start_date` DATE NULL COMMENT '동아리 모집 시작 날짜', - `end_date` DATE NULL COMMENT '동아리 모집 마감 날짜', - `is_always_recruiting` TINYINT(1) NOT NULL COMMENT '동아리 상시 모집 여부', - `image_url` VARCHAR(255) NULL COMMENT '동아리 모집 이미지', - `content` TEXT NULL COMMENT '동아리 모집 내용', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', - PRIMARY KEY (`id`), - UNIQUE KEY `uk_club_recruitment_club_id` (`club_id`), - CONSTRAINT `fk_club` FOREIGN KEY (`club_id`) REFERENCES `koin`.`club` (`id`) -); diff --git a/src/main/resources/db/migration/V195__add_club_event.sql b/src/main/resources/db/migration/V195__add_club_event.sql deleted file mode 100644 index dfabfbca1f..0000000000 --- a/src/main/resources/db/migration/V195__add_club_event.sql +++ /dev/null @@ -1,17 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`club_event` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '동아리 행사 고유 ID', - `club_id` INT UNSIGNED NOT NULL COMMENT '동아리 고유 ID', - `name` VARCHAR(30) NOT NULL COMMENT '동아리 행사 이름', - `start_date` DATETIME NOT NULL COMMENT '동아리 행사 시작 날짜', - `end_date` DATETIME NOT NULL COMMENT '동아리 행사 종료 날짜', - `introduce` VARCHAR(70) NOT NULL COMMENT '동아리 행사 간단 소개', - `content` TEXT NULL COMMENT '동아리 행사 상세 설명', - `notified_before_one_hour` TINYINT(1) NOT NULL COMMENT '1시간 전 알림 발송 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', - PRIMARY KEY (`id`), - CONSTRAINT `fk_club_event_club` FOREIGN KEY (`club_id`) REFERENCES `koin`.`club` (`id`) ON DELETE CASCADE -); - -CREATE INDEX `idx_notified_startdate` ON `koin`.`club_event` (`notified_before_one_hour`, `start_date`); diff --git a/src/main/resources/db/migration/V196__add_club_name_index.sql b/src/main/resources/db/migration/V196__add_club_name_index.sql deleted file mode 100644 index b860f97d37..0000000000 --- a/src/main/resources/db/migration/V196__add_club_name_index.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX idx_club_name ON club(name); diff --git a/src/main/resources/db/migration/V197__add_club_recruitment_subscription.sql b/src/main/resources/db/migration/V197__add_club_recruitment_subscription.sql deleted file mode 100644 index 8977a4f374..0000000000 --- a/src/main/resources/db/migration/V197__add_club_recruitment_subscription.sql +++ /dev/null @@ -1,12 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`club_recruitment_subscription` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '동아리 모집 고유 ID', - `club_id` INT UNSIGNED NOT NULL COMMENT '동아리 고유 ID', - `user_id` INT UNSIGNED NOT NULL COMMENT '유저 고유 ID', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', - PRIMARY KEY (`id`), - FOREIGN KEY (`club_id`) REFERENCES `koin`.`club` (`id`) ON DELETE CASCADE, - FOREIGN KEY (`user_id`) REFERENCES `koin`.`users` (`id`) ON DELETE CASCADE, - UNIQUE KEY `uniq_club_user` (`club_id`, `user_id`) -); diff --git a/src/main/resources/db/migration/V198__add_club_event_subscription.sql b/src/main/resources/db/migration/V198__add_club_event_subscription.sql deleted file mode 100644 index 29705ed1b3..0000000000 --- a/src/main/resources/db/migration/V198__add_club_event_subscription.sql +++ /dev/null @@ -1,12 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`club_event_subscription` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '동아리 모집 고유 ID', - `event_id` INT UNSIGNED NOT NULL COMMENT '동아리 이벤트 고유 ID', - `user_id` INT UNSIGNED NOT NULL COMMENT '유저 고유 ID', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', - PRIMARY KEY (`id`), - FOREIGN KEY (`event_id`) REFERENCES `koin`.`club_event` (`id`) ON DELETE CASCADE, - FOREIGN KEY (`user_id`) REFERENCES `koin`.`users` (`id`) ON DELETE CASCADE, - UNIQUE KEY `uniq_event_user` (`event_id`, `user_id`) -); diff --git a/src/main/resources/db/migration/V199__add_club_event_image.sql b/src/main/resources/db/migration/V199__add_club_event_image.sql deleted file mode 100644 index 03511f5a20..0000000000 --- a/src/main/resources/db/migration/V199__add_club_event_image.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`club_event_image` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '동아리 행사 이미지 고유 ID', - `club_event_id` INT UNSIGNED NOT NULL COMMENT '동아리 행사 고유 ID', - `image_url` VARCHAR(255) NOT NULL COMMENT '이미지 URL', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', - PRIMARY KEY (`id`), - FOREIGN KEY (`club_event_id`) REFERENCES `koin`.`club_event` (`id`) ON DELETE CASCADE -); diff --git a/src/main/resources/db/migration/V19__update_coop_id_with_user_email.sql b/src/main/resources/db/migration/V19__update_coop_id_with_user_email.sql deleted file mode 100644 index cd00a55af9..0000000000 --- a/src/main/resources/db/migration/V19__update_coop_id_with_user_email.sql +++ /dev/null @@ -1,3 +0,0 @@ -UPDATE coop - JOIN users ON coop.user_id = users.id - SET coop.coop_id = users.email; diff --git a/src/main/resources/db/migration/V1__baseline_schema.sql b/src/main/resources/db/migration/V1__baseline_schema.sql new file mode 100644 index 0000000000..f3fb330553 --- /dev/null +++ b/src/main/resources/db/migration/V1__baseline_schema.sql @@ -0,0 +1,1988 @@ +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; +SET UNIQUE_CHECKS = 0; + +CREATE TABLE `abtest` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `title` varchar(255) NOT NULL, + `display_title` varchar(255) NOT NULL, + `description` varchar(255) DEFAULT NULL, + `creator` varchar(50) DEFAULT NULL, + `team` varchar(50) DEFAULT NULL, + `winner_id` int unsigned DEFAULT NULL, + `status` varchar(50) NOT NULL DEFAULT 'IN_PROGRESS', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `title_UNIQUE` (`title`), + KEY `FK_ABTEST_ON_WINNER_ID_idx` (`winner_id`), + CONSTRAINT `FK_ABTEST_ON_WINNER_ID` FOREIGN KEY (`winner_id`) REFERENCES `abtest_variable` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `abtest_variable` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `abtest_id` int unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `display_name` varchar(255) NOT NULL, + `rate` int unsigned NOT NULL, + `count` int NOT NULL DEFAULT '0', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `FK_ABTEST_VARIABLE_ON_ABTEST_ID_idx` (`abtest_id`), + CONSTRAINT `FK_ABTEST_VARIABLE_ON_ABTEST_ID` FOREIGN KEY (`abtest_id`) REFERENCES `abtest` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `access_history` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `device_id` int unsigned DEFAULT NULL, + `last_accessed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `FK_ACCESS_HISTORY_ON_DEVICE_ID_idx` (`device_id`), + CONSTRAINT `FK_ACCESS_HISTORY_ON_DEVICE_ID` FOREIGN KEY (`device_id`) REFERENCES `device` (`id`) ON DELETE SET NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `access_history_abtest_variable` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `access_history_id` int unsigned NOT NULL, + `variable_id` int unsigned NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `FK_ACCESS_HISTORY_ABTEST_VARIABLE_ON_ACCESS_HISTORY_ID_idx` (`access_history_id`), + KEY `FK_ACCESS_HISTORY_ABTEST_VARIABLE_ON_ACCESS_VARIABLE_ID_idx` (`variable_id`), + CONSTRAINT `FK_ACCESS_HISTORY_ABTEST_VARIABLE_ON_ACCESS_HISTORY_ID` FOREIGN KEY (`access_history_id`) REFERENCES `access_history` (`id`), + CONSTRAINT `FK_ACCESS_HISTORY_ABTEST_VARIABLE_ON_ACCESS_VARIABLE_ID` FOREIGN KEY (`variable_id`) REFERENCES `abtest_variable` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `activities` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'activities 고유 id', + `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_bin NOT NULL COMMENT '활동명', + `description` text CHARACTER SET utf8mb3 COLLATE utf8_bin COMMENT '활동 설명', + `image_urls` text CHARACTER SET utf8mb3 COLLATE utf8_bin COMMENT '이미지 링크', + `date` date NOT NULL COMMENT '활동 일자', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin; + +CREATE TABLE `admins` ( + `user_id` int unsigned NOT NULL COMMENT 'user 고유 id', + `team_type` varchar(255) NOT NULL COMMENT '팀 타입', + `track_type` varchar(255) NOT NULL COMMENT '트랙 타입', + `can_create_admin` tinyint(1) NOT NULL DEFAULT '0' COMMENT '어드민 계정 생성 권한', + `super_admin` tinyint(1) NOT NULL DEFAULT '0' COMMENT '슈퍼 어드민 권한', + `login_id` varchar(255) NOT NULL, + `email` varchar(255) NOT NULL, + PRIMARY KEY (`user_id`), + UNIQUE KEY `uq_admin_login_id` (`login_id`), + UNIQUE KEY `uq_admin_email` (`email`), + CONSTRAINT `FK_ADMIN_ON_USER` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `admins_activity_history` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 id', + `domain_id` int unsigned DEFAULT NULL COMMENT '도메인 엔티티 id', + `admin_id` int unsigned NOT NULL COMMENT '어드민 고유 id', + `request_method` varchar(10) NOT NULL COMMENT 'HTTP 요청 메소드', + `domain_name` varchar(20) NOT NULL COMMENT '도메인 이름', + `request_message` text COMMENT 'HTTP 요청 메시지 바디', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`), + KEY `FK_HISTORY_ON_ADMIN` (`admin_id`), + CONSTRAINT `FK_HISTORY_ON_ADMIN` FOREIGN KEY (`admin_id`) REFERENCES `admins` (`user_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `article_attachments` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `article_id` int unsigned NOT NULL, + `hash` binary(32) NOT NULL, + `url` text NOT NULL, + `name` text NOT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `ux_article_attachment` (`article_id`,`hash`), + KEY `FK_ARTICLE_ATTACHMENTS_ON_ARTICLE_ID_idx` (`article_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `article_keyword_user_map` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `keyword_id` int unsigned NOT NULL, + `user_id` int unsigned NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_keyword_user` (`keyword_id`,`user_id`), + KEY `user_id` (`user_id`), + CONSTRAINT `article_keyword_user_map_ibfk_1` FOREIGN KEY (`keyword_id`) REFERENCES `article_keywords` (`id`) ON DELETE CASCADE, + CONSTRAINT `article_keyword_user_map_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `article_keywords` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `keyword` varchar(50) NOT NULL, + `category` varchar(20) NOT NULL DEFAULT 'KOREATECH', + `last_used_at` timestamp NULL DEFAULT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `is_filtered` tinyint(1) NOT NULL DEFAULT '0', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_article_keywords_keyword_category` (`keyword`,`category`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `article_search_keyword_ip_map` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `keyword_id` int unsigned NOT NULL, + `ip_address` varchar(45) NOT NULL, + `search_count` int unsigned NOT NULL DEFAULT '1', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_keyword_ip` (`keyword_id`,`ip_address`), + KEY `idx_ip_address` (`ip_address`), + CONSTRAINT `article_search_keyword_ip_map_ibfk_1` FOREIGN KEY (`keyword_id`) REFERENCES `article_search_keywords` (`id`), + CONSTRAINT `fk_keyword_id` FOREIGN KEY (`keyword_id`) REFERENCES `article_search_keywords` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `article_search_keywords` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `keyword` varchar(255) NOT NULL, + `weight` double NOT NULL DEFAULT '1', + `last_searched_at` timestamp NULL DEFAULT NULL, + `total_searches` int unsigned NOT NULL DEFAULT '0', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `keyword` (`keyword`), + KEY `idx_keyword` (`keyword`), + KEY `idx_last_searched_at` (`last_searched_at`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `article_view_logs` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'article view logs 고유 id', + `article_id` int unsigned NOT NULL COMMENT 'article 고유 id', + `user_id` int unsigned DEFAULT NULL COMMENT '본 사람 user 고유 id', + `expired_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '만료 시간', + `ip` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci NOT NULL COMMENT 'IP 주소', + PRIMARY KEY (`id`), + UNIQUE KEY `article_view_logs_article_id_user_id_unique` (`article_id`,`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci; + +CREATE TABLE `banner_categories` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `name` varchar(255) NOT NULL COMMENT '배너 카테고리 이름', + `description` varchar(255) NOT NULL COMMENT '배너 카테고리 설명', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `banners` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `title` varchar(255) NOT NULL COMMENT '배너 이름', + `banner_category_id` int unsigned NOT NULL COMMENT '배너 카테고리 ID', + `priority` int unsigned DEFAULT NULL COMMENT '배너 우선 순위', + `image_url` varchar(255) NOT NULL COMMENT '배너 이미지 URL', + `web_redirect_link` varchar(255) DEFAULT NULL COMMENT '웹 리다이렉션 URL', + `android_redirect_link` varchar(255) DEFAULT NULL COMMENT '안드로이드 리다이렉션 URL', + `android_minimum_version` varchar(50) DEFAULT NULL COMMENT '안드로이드 최소 버전', + `ios_redirect_link` varchar(255) DEFAULT NULL COMMENT 'IOS 리다이렉션 URL', + `ios_minimum_version` varchar(50) DEFAULT NULL COMMENT 'IOS 최소 버전', + `is_active` tinyint(1) NOT NULL COMMENT '배너 활성화 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + `is_web_released` tinyint(1) NOT NULL DEFAULT '0' COMMENT '웹 배포 여부', + `is_android_released` tinyint(1) NOT NULL DEFAULT '0' COMMENT '안드로이드 배포 여부', + `is_ios_released` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'IOS 배포 여부', + PRIMARY KEY (`id`), + KEY `banner_category_id` (`banner_category_id`), + CONSTRAINT `banners_ibfk_1` FOREIGN KEY (`banner_category_id`) REFERENCES `banner_categories` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `boards` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'board 고유 id', + `name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci NOT NULL COMMENT '게시판 이름', + `is_anonymous` tinyint(1) NOT NULL DEFAULT '0' COMMENT '익명 닉네임을 사용하는지 여부', + `article_count` int unsigned NOT NULL DEFAULT '0' COMMENT '게시글 개수', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + `is_notice` tinyint(1) NOT NULL DEFAULT '0' COMMENT '공지사항인지 여부', + `parent_id` int unsigned DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci; + +CREATE TABLE `callvan_chat_message` ( + `id` int NOT NULL AUTO_INCREMENT, + `callvan_chat_room_id` int NOT NULL, + `sender_id` int NOT NULL, + `sender_nickname` varchar(50) NOT NULL COMMENT '비정규화', + `message_type` varchar(20) NOT NULL DEFAULT 'TEXT' COMMENT 'TEXT, IMAGE', + `content` text, + `is_image` tinyint(1) NOT NULL DEFAULT '0', + `is_left_user` tinyint(1) NOT NULL DEFAULT '0', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', + PRIMARY KEY (`id`), + KEY `idx_chat_message_room_created` (`callvan_chat_room_id`,`created_at`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `callvan_chat_room` ( + `id` int NOT NULL AUTO_INCREMENT, + `callvan_post_id` int NOT NULL, + `room_name` varchar(100) NOT NULL COMMENT '출발지 -> 도착지 시간 인원수 형식', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', + PRIMARY KEY (`id`), + UNIQUE KEY `callvan_post_id` (`callvan_post_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `callvan_notification` ( + `id` int NOT NULL AUTO_INCREMENT, + `recipient_id` int NOT NULL, + `notification_type` varchar(30) NOT NULL COMMENT 'RECRUITMENT_COMPLETE, NEW_MESSAGE, PARTICIPANT_JOINED, DEPARTURE_IMMINENT', + `callvan_post_id` int DEFAULT NULL, + `departure_type` varchar(20) DEFAULT NULL, + `departure_custom_name` varchar(50) DEFAULT NULL, + `arrival_type` varchar(20) DEFAULT NULL, + `arrival_custom_name` varchar(50) DEFAULT NULL, + `departure_date` date DEFAULT NULL, + `departure_time` time DEFAULT NULL, + `current_participants` int DEFAULT NULL, + `max_participants` int DEFAULT NULL, + `sender_nickname` varchar(50) DEFAULT NULL, + `message_preview` varchar(100) DEFAULT NULL, + `callvan_chat_room_id` int DEFAULT NULL, + `joined_member_nickname` varchar(50) DEFAULT NULL, + `is_read` tinyint(1) NOT NULL DEFAULT '0', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', + PRIMARY KEY (`id`), + KEY `idx_notification_recipient_read` (`recipient_id`,`is_read`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `callvan_participant` ( + `id` int NOT NULL AUTO_INCREMENT, + `post_id` int NOT NULL, + `member_id` int NOT NULL, + `role` varchar(20) NOT NULL DEFAULT 'PARTICIPANT' COMMENT 'AUTHOR, PARTICIPANT', + `joined_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_participant_post_member` (`post_id`,`member_id`), + KEY `idx_participant_member_id` (`member_id`), + KEY `idx_participant_post_id` (`post_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `callvan_post` ( + `id` int NOT NULL AUTO_INCREMENT, + `author_id` int NOT NULL COMMENT '작성자 user_id', + `title` varchar(100) NOT NULL, + `departure_type` varchar(20) NOT NULL COMMENT '정문, 후문, 테니스장, 본관동, 별관동, 천안터미널, 천안역, 천안아산역, CUSTOM', + `departure_custom_name` varchar(50) DEFAULT NULL COMMENT 'departure_type이 CUSTOM일 때 사용', + `arrival_type` varchar(20) NOT NULL COMMENT '정문, 후문, 테니스장, 본관동, 별관동, 천안터미널, 천안역, 천안아산역, CUSTOM', + `arrival_custom_name` varchar(50) DEFAULT NULL COMMENT 'arrival_type이 CUSTOM일 때 사용', + `departure_date` date NOT NULL, + `departure_time` time NOT NULL, + `max_participants` int NOT NULL COMMENT '2~11명', + `current_participants` int NOT NULL DEFAULT '1', + `status` varchar(20) NOT NULL DEFAULT 'RECRUITING' COMMENT 'RECRUITING, CLOSED, COMPLETED', + `chat_room_id` int DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', + PRIMARY KEY (`id`), + KEY `idx_callvan_post_status` (`status`), + KEY `idx_callvan_post_departure_date_time` (`departure_date`,`departure_time`), + KEY `idx_callvan_post_author_id` (`author_id`), + KEY `idx_callvan_post_departure_type` (`departure_type`), + KEY `idx_callvan_post_arrival_type` (`arrival_type`), + KEY `idx_callvan_post_filter_composite` (`status`,`departure_date`,`departure_time`), + KEY `idx_callvan_post_location_composite` (`departure_type`,`arrival_type`,`status`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `callvan_report` ( + `id` int NOT NULL AUTO_INCREMENT, + `callvan_post_id` int DEFAULT NULL COMMENT '신고 접수된 콜벤팟 게시글 id', + `reporter_id` int NOT NULL COMMENT '신고자 user_id', + `reported_id` int NOT NULL COMMENT '피신고자 user_id', + `description` text COMMENT '신고 상세 내용(상황 설명 등)', + `status` varchar(20) NOT NULL DEFAULT 'PENDING' COMMENT 'PENDING, UNDER_REVIEW, CONFIRMED, REJECTED, CANCELED', + `reviewer_id` int DEFAULT NULL COMMENT '운영 검토자 user_id (Admin)', + `review_note` varchar(500) DEFAULT NULL COMMENT '운영 메모/판단 근거', + `reviewed_at` timestamp NULL DEFAULT NULL, + `confirmed_at` timestamp NULL DEFAULT NULL COMMENT 'CONFIRMED 시각(누적/제재 기준 시각)', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `idx_callvan_report_status_created` (`status`,`created_at`), + KEY `idx_callvan_report_reported_status` (`reported_id`,`status`,`confirmed_at`), + KEY `idx_callvan_report_reporter_created` (`reporter_id`,`created_at`), + KEY `idx_callvan_report_post` (`callvan_post_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `callvan_report_attachment` ( + `id` int NOT NULL AUTO_INCREMENT, + `report_id` int NOT NULL COMMENT 'callvan_report.id', + `attachment_type` varchar(30) NOT NULL COMMENT 'IMAGE', + `url` varchar(500) NOT NULL COMMENT 'url', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `idx_report_attachment_report` (`report_id`,`is_deleted`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `callvan_report_process` ( + `id` int NOT NULL AUTO_INCREMENT, + `report_id` int NOT NULL COMMENT 'callvan_report.id', + `processor_id` int NOT NULL COMMENT '어드민 처리자', + `process_type` varchar(50) NOT NULL COMMENT 'WARNING, TEMPORARY_RESTRICTION_14_DAYS, PERMANENT_RESTRICTION, REJECT', + `restricted_until` datetime DEFAULT NULL COMMENT '14일 제한 종료일', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `idx_callvan_report_process_report` (`report_id`,`is_deleted`), + KEY `idx_callvan_report_process_processor` (`processor_id`,`is_deleted`), + KEY `idx_callvan_report_process_type_until` (`process_type`,`restricted_until`,`is_deleted`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `callvan_report_reason` ( + `id` int NOT NULL AUTO_INCREMENT, + `report_id` int NOT NULL COMMENT 'callvan_report.id', + `reason_code` varchar(30) NOT NULL COMMENT 'NO_SHOW, NON_PAYMENT, PROFANITY, OTHER', + `custom_text` varchar(200) DEFAULT NULL COMMENT '기타 사유 직접 입력', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `idx_report_reason_report` (`report_id`), + KEY `idx_report_reason_code` (`reason_code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `campus_delivery_address` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '교내 배달 주소 ID', + `campus_address_type_id` int unsigned NOT NULL COMMENT '교내 배달 주소 타입 ID', + `full_address` varchar(255) NOT NULL COMMENT '교내 배달 전체 주소', + `short_address` varchar(50) NOT NULL COMMENT '교내 배달 요약 주소', + `latitude` decimal(10,8) DEFAULT NULL COMMENT '위도', + `longitude` decimal(11,8) DEFAULT NULL COMMENT '경도', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + `address` text COMMENT '캠퍼스 배달 주소', + PRIMARY KEY (`id`), + KEY `idx_campus_delivery_address` (`campus_address_type_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `campus_delivery_address_type` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '교내 주소 타입 ID', + `name` varchar(255) NOT NULL COMMENT '교내 주소 타입 이름', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `cart` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `user_id` int unsigned NOT NULL COMMENT '사용자 ID', + `orderable_shop_id` int unsigned NOT NULL COMMENT '주문 가능 상점 ID', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_user_orderable_shop` (`user_id`,`orderable_shop_id`), + KEY `idx_user_id_orderable_shop_id` (`user_id`,`orderable_shop_id`), + KEY `idx_orderable_shop_id` (`orderable_shop_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `cart_menu_item` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `cart_id` int unsigned NOT NULL COMMENT '장바구니 ID', + `orderable_shop_menu_id` int unsigned NOT NULL COMMENT '상점 메뉴 ID', + `orderable_shop_menu_price_id` int unsigned NOT NULL COMMENT '상점 메뉴 가격 ID', + `quantity` int unsigned NOT NULL COMMENT '메뉴 수량', + `is_modified` tinyint(1) NOT NULL DEFAULT '0' COMMENT '메뉴 정보 변경 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + KEY `idx_cart_id` (`cart_id`,`orderable_shop_menu_id`,`orderable_shop_menu_price_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `cart_menu_item_option` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `cart_menu_item_id` int unsigned NOT NULL COMMENT '장바구니 메뉴 ID', + `orderable_shop_menu_option_id` int unsigned NOT NULL COMMENT '상점 메뉴 옵션 ID', + `option_name` varchar(255) NOT NULL COMMENT '옵션 이름', + `option_price` int unsigned NOT NULL COMMENT '옵션 가격', + `quantity` int unsigned NOT NULL COMMENT '옵션 수량', + `is_modified` tinyint(1) NOT NULL DEFAULT '0' COMMENT '옵션 정보 변경 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + KEY `idx_cart_menu_item_id` (`cart_menu_item_id`,`orderable_shop_menu_option_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `catalog` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 id', + `code` varchar(20) NOT NULL COMMENT '강의 코드', + `year` varchar(20) NOT NULL COMMENT '년도', + `lecture_name` varchar(255) NOT NULL COMMENT '강의 이름', + `department_id` int unsigned NOT NULL COMMENT '학과 id', + `major_id` int unsigned DEFAULT NULL COMMENT '전공 id', + `general_education_area_id` int unsigned DEFAULT NULL COMMENT '교양 영역 id', + `credit` int unsigned NOT NULL DEFAULT '0' COMMENT '학점', + `course_type_id` int unsigned NOT NULL COMMENT '이수 구분 id', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + KEY `major_id` (`major_id`), + KEY `course_type_id` (`course_type_id`), + KEY `department_id` (`department_id`), + KEY `general_education_area_id` (`general_education_area_id`), + KEY `idx_catalog_code_year` (`code`,`year`), + KEY `idx_catalog_lecture_name` (`lecture_name`,`year`), + CONSTRAINT `catalog_ibfk_1` FOREIGN KEY (`major_id`) REFERENCES `major` (`id`), + CONSTRAINT `catalog_ibfk_2` FOREIGN KEY (`course_type_id`) REFERENCES `course_type` (`id`), + CONSTRAINT `catalog_ibfk_3` FOREIGN KEY (`department_id`) REFERENCES `department` (`id`), + CONSTRAINT `catalog_ibfk_4` FOREIGN KEY (`general_education_area_id`) REFERENCES `general_education_area` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `club` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `club_category_id` int unsigned NOT NULL COMMENT '동아리 카테고리 ID', + `name` varchar(50) NOT NULL COMMENT '동아리 이름', + `hits` int unsigned NOT NULL DEFAULT '0' COMMENT '조회수', + `description` varchar(100) NOT NULL COMMENT '동아리 소개', + `is_active` tinyint(1) NOT NULL DEFAULT '0' COMMENT '활성화 여부', + `image_url` varchar(255) NOT NULL COMMENT '동아리 사진', + `likes` int unsigned NOT NULL DEFAULT '0' COMMENT '동아리 좋아요 개수', + `location` varchar(20) NOT NULL COMMENT '동아리 장소', + `last_week_hits` int unsigned NOT NULL DEFAULT '0' COMMENT '지난 주 조회수', + `introduction` text NOT NULL COMMENT '동아리 상세 소개', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + `is_like_hidden` tinyint(1) NOT NULL DEFAULT '0' COMMENT '좋아요 숨김 여부', + `normalized_name` varchar(50) NOT NULL COMMENT '검색용 정규화 이름', + PRIMARY KEY (`id`), + KEY `club_category_id` (`club_category_id`), + KEY `idx_club_normalized_name` (`normalized_name`), + CONSTRAINT `club_ibfk_1` FOREIGN KEY (`club_category_id`) REFERENCES `club_category` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `club_category` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `name` varchar(255) NOT NULL COMMENT '동아리 카테고리 이름', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `club_event` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '동아리 행사 고유 ID', + `club_id` int unsigned NOT NULL COMMENT '동아리 고유 ID', + `name` varchar(30) NOT NULL COMMENT '동아리 행사 이름', + `start_date` datetime NOT NULL COMMENT '동아리 행사 시작 날짜', + `end_date` datetime NOT NULL COMMENT '동아리 행사 종료 날짜', + `introduce` varchar(70) NOT NULL COMMENT '동아리 행사 간단 소개', + `content` text COMMENT '동아리 행사 상세 설명', + `notified_before_one_hour` tinyint(1) NOT NULL COMMENT '1시간 전 알림 발송 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', + PRIMARY KEY (`id`), + KEY `fk_club_event_club` (`club_id`), + KEY `idx_notified_startdate` (`notified_before_one_hour`,`start_date`), + CONSTRAINT `fk_club_event_club` FOREIGN KEY (`club_id`) REFERENCES `club` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `club_event_image` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '동아리 행사 이미지 고유 ID', + `club_event_id` int unsigned NOT NULL COMMENT '동아리 행사 고유 ID', + `image_url` varchar(255) NOT NULL COMMENT '이미지 URL', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', + PRIMARY KEY (`id`), + KEY `club_event_id` (`club_event_id`), + CONSTRAINT `club_event_image_ibfk_1` FOREIGN KEY (`club_event_id`) REFERENCES `club_event` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `club_event_subscription` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '동아리 모집 고유 ID', + `event_id` int unsigned NOT NULL COMMENT '동아리 이벤트 고유 ID', + `user_id` int unsigned NOT NULL COMMENT '유저 고유 ID', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', + PRIMARY KEY (`id`), + UNIQUE KEY `uniq_event_user` (`event_id`,`user_id`), + KEY `user_id` (`user_id`), + CONSTRAINT `club_event_subscription_ibfk_1` FOREIGN KEY (`event_id`) REFERENCES `club_event` (`id`) ON DELETE CASCADE, + CONSTRAINT `club_event_subscription_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `club_hot` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `club_id` int unsigned NOT NULL COMMENT '인기 동아리 고유 ID', + `ranking` int unsigned NOT NULL COMMENT '순위', + `period_hits` int unsigned NOT NULL DEFAULT '0' COMMENT '기간 조회수', + `start_date` date NOT NULL COMMENT '집계 시작일', + `end_date` date NOT NULL COMMENT '집계 종료일', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + KEY `club_id` (`club_id`), + CONSTRAINT `club_hot_ibfk_1` FOREIGN KEY (`club_id`) REFERENCES `club` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `club_like` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `club_id` int unsigned NOT NULL COMMENT '동아리 고유 ID', + `user_id` int unsigned NOT NULL COMMENT '유저 ID', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + KEY `club_id` (`club_id`), + KEY `user_id` (`user_id`), + CONSTRAINT `club_like_ibfk_1` FOREIGN KEY (`club_id`) REFERENCES `club` (`id`), + CONSTRAINT `club_like_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `club_manager` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `club_id` int unsigned NOT NULL COMMENT '동아리 고유 ID', + `user_id` int unsigned NOT NULL COMMENT '동아리 관리자 유저 ID', + PRIMARY KEY (`id`), + KEY `club_id` (`club_id`), + KEY `user_id` (`user_id`), + CONSTRAINT `club_manager_ibfk_1` FOREIGN KEY (`club_id`) REFERENCES `club` (`id`), + CONSTRAINT `club_manager_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `club_qna` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `club_id` int unsigned NOT NULL COMMENT '동아리 고유 ID', + `author_id` int unsigned DEFAULT NULL COMMENT '작성자 ID', + `parent_id` int unsigned DEFAULT NULL COMMENT '부모 qna ID', + `content` varchar(255) NOT NULL COMMENT '내용', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `is_manager` tinyint(1) NOT NULL COMMENT '관리자 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + KEY `club_id` (`club_id`), + KEY `author_id` (`author_id`), + KEY `parent_id` (`parent_id`), + CONSTRAINT `club_qna_ibfk_1` FOREIGN KEY (`club_id`) REFERENCES `club` (`id`), + CONSTRAINT `club_qna_ibfk_2` FOREIGN KEY (`author_id`) REFERENCES `users` (`id`) ON DELETE SET NULL, + CONSTRAINT `club_qna_ibfk_3` FOREIGN KEY (`parent_id`) REFERENCES `club_qna` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `club_recruitment` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '동아리 모집 고유 ID', + `club_id` int unsigned NOT NULL COMMENT '동아리 고유 ID', + `start_date` date DEFAULT NULL COMMENT '동아리 모집 시작 날짜', + `end_date` date DEFAULT NULL COMMENT '동아리 모집 마감 날짜', + `is_always_recruiting` tinyint(1) NOT NULL COMMENT '동아리 상시 모집 여부', + `image_url` varchar(255) DEFAULT NULL COMMENT '동아리 모집 이미지', + `content` text COMMENT '동아리 모집 내용', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_club_recruitment_club_id` (`club_id`), + CONSTRAINT `fk_club` FOREIGN KEY (`club_id`) REFERENCES `club` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `club_recruitment_subscription` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '동아리 모집 고유 ID', + `club_id` int unsigned NOT NULL COMMENT '동아리 고유 ID', + `user_id` int unsigned NOT NULL COMMENT '유저 고유 ID', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', + PRIMARY KEY (`id`), + UNIQUE KEY `uniq_club_user` (`club_id`,`user_id`), + KEY `user_id` (`user_id`), + CONSTRAINT `club_recruitment_subscription_ibfk_1` FOREIGN KEY (`club_id`) REFERENCES `club` (`id`) ON DELETE CASCADE, + CONSTRAINT `club_recruitment_subscription_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `club_sns` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `club_id` int unsigned NOT NULL COMMENT '동아리 고유 ID', + `sns_type` varchar(50) NOT NULL COMMENT '동아리 SNS 타입', + `contact` varchar(255) NOT NULL COMMENT '동아리 SNS 연락처', + PRIMARY KEY (`id`), + KEY `club_id` (`club_id`), + CONSTRAINT `club_sns_ibfk_1` FOREIGN KEY (`club_id`) REFERENCES `club` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `comments` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'comment 고유 id', + `article_id` int unsigned NOT NULL COMMENT '게시글 고유 id', + `content` text CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci NOT NULL COMMENT '내용', + `user_id` int unsigned NOT NULL COMMENT '답글 user 고유 id', + `nickname` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci NOT NULL COMMENT '답글 user 닉네임', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci; + +CREATE TABLE `coop` ( + `user_id` int unsigned NOT NULL COMMENT '유저 id, user_type COOP으로 가져옴', + `coop_id` varchar(255) NOT NULL, + PRIMARY KEY (`user_id`), + CONSTRAINT `FK_COOP_ON_USER` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `coop_names` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 id', + `name` varchar(255) NOT NULL COMMENT '생협 운영장 이름', + `icon_url` varchar(500) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `coop_opens` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'coop_open 고유 id', + `coop_shop_id` int unsigned DEFAULT NULL, + `type` varchar(10) DEFAULT NULL COMMENT '기타 타입(아침, 점심, 저녁)', + `day_of_week` varchar(10) NOT NULL COMMENT '요일', + `open_time` varchar(10) DEFAULT NULL COMMENT '오픈 시간', + `close_time` varchar(10) DEFAULT NULL COMMENT '마감 시간', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`), + KEY `FK_COOP_ID` (`coop_shop_id`), + CONSTRAINT `FK_COOP_SHOP_ID` FOREIGN KEY (`coop_shop_id`) REFERENCES `coop_shop` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `coop_semester` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `semester` varchar(200) NOT NULL, + `from_date` date NOT NULL, + `to_date` date NOT NULL, + `is_applied` tinyint(1) NOT NULL DEFAULT '1', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `semester` (`semester`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `coop_shop` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'coop 고유 id', + `phone` varchar(50) DEFAULT NULL COMMENT '생협 매장 연락처', + `location` varchar(50) NOT NULL COMMENT '생협 매장 위치', + `remarks` text COMMENT '특이사항', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '업데이트 일자', + `semester_id` int unsigned DEFAULT NULL, + `coop_name_id` int unsigned DEFAULT NULL COMMENT '생협 운영장 고유 id', + PRIMARY KEY (`id`), + KEY `coop_semester_fk_id` (`semester_id`), + KEY `coop_name_fk_id` (`coop_name_id`), + CONSTRAINT `coop_name_fk_id` FOREIGN KEY (`coop_name_id`) REFERENCES `coop_names` (`id`) ON DELETE CASCADE, + CONSTRAINT `coop_semester_fk_id` FOREIGN KEY (`semester_id`) REFERENCES `coop_semester` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `course_type` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 id', + `name` varchar(255) NOT NULL COMMENT '이수 구분 이름', + `is_deleted` tinyint DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `courses` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `region` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, + `bus_type` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; + +CREATE TABLE `department` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 id', + `name` varchar(255) NOT NULL COMMENT '학과 이름', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `detect_graduation_calculation` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 id', + `user_id` int unsigned DEFAULT NULL COMMENT '유저 id', + `is_changed` tinyint(1) DEFAULT '0' COMMENT '졸업학점 계산 변경 여부', + PRIMARY KEY (`id`), + UNIQUE KEY `unique_user` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `device` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `user_id` int unsigned NOT NULL, + `model` varchar(100) DEFAULT NULL, + `type` varchar(100) DEFAULT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `FK_DEVICE_ON_USER_ID_idx` (`user_id`), + CONSTRAINT `FK_DEVICE_ON_USER_ID` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `dining_likes` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `dining_id` int NOT NULL, + `user_id` int NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `dining_menus` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'dining menus 고유 id', + `date` date NOT NULL COMMENT '일자', + `type` varchar(9) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci NOT NULL COMMENT '식사 유형(아침 , 점심, 저녁)', + `place` varchar(9) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci NOT NULL COMMENT '종류(양식, 한식..)', + `price_card` int unsigned DEFAULT NULL COMMENT '카드 금액', + `price_cash` int unsigned DEFAULT NULL COMMENT '현금 금액', + `kcal` int unsigned DEFAULT NULL COMMENT '칼로리', + `menu` text CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci NOT NULL COMMENT '메뉴', + `image_url` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci DEFAULT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + `sold_out` datetime DEFAULT NULL, + `is_changed` datetime DEFAULT NULL, + `likes` int DEFAULT '0', + `price` int unsigned DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `ux_date_type_place` (`date`,`type`,`place`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci; + +CREATE TABLE `event_article_thumbnail_images` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `event_id` int unsigned NOT NULL, + `thumbnail_image` varchar(255) DEFAULT NULL, + `created_at` timestamp NOT NULL, + `updated_at` timestamp NOT NULL, + PRIMARY KEY (`id`), + KEY `FK_EVENT_ARTICLE_THUMBNAIL_IMAGES_ON_EVENT_ARTICLES` (`event_id`), + CONSTRAINT `FK_EVENT_ARTICLE_THUMBNAIL_IMAGES_ON_EVENT_ARTICLES` FOREIGN KEY (`event_id`) REFERENCES `event_articles` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `event_articles` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'event articles 고유 id', + `shop_id` int unsigned NOT NULL COMMENT 'Shop(가게) 고유 id', + `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_bin NOT NULL COMMENT '제목', + `content` text CHARACTER SET utf8mb3 COLLATE utf8_bin NOT NULL COMMENT '내용', + `user_id` int NOT NULL COMMENT 'user(작성자) 고유 id', + `hit` int NOT NULL DEFAULT '0' COMMENT '조회수', + `ip` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8_bin NOT NULL COMMENT 'IP 주소', + `start_date` date NOT NULL COMMENT '행사 시작일', + `end_date` date NOT NULL COMMENT '행사 마감일', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`), + UNIQUE KEY `pk` (`id`), + KEY `idx_timestamp` (`created_at`), + KEY `idx_is_deleted` (`is_deleted`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin; + +CREATE TABLE `event_articles_view_logs` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'event articles view logs 고유 id', + `event_articles_id` int unsigned NOT NULL COMMENT 'event articles 고유 id', + `user_id` int unsigned DEFAULT NULL COMMENT '게시물을 본 user 고유 id', + `expired_at` timestamp NULL DEFAULT NULL COMMENT '만료 일자', + `ip` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8_bin NOT NULL COMMENT 'IP 주소', + PRIMARY KEY (`id`), + UNIQUE KEY `idx_unique` (`event_articles_id`,`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin; + +CREATE TABLE `general_education_area` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 id', + `name` varchar(20) NOT NULL COMMENT '교양 영역 이름', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `koin_notice` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `article_id` int unsigned NOT NULL COMMENT '게시글 고유 ID', + `admin_id` int unsigned NOT NULL COMMENT '어드민 고유 ID', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`), + KEY `article_id` (`article_id`), + KEY `admin_id` (`admin_id`), + CONSTRAINT `koin_notice_ibfk_1` FOREIGN KEY (`article_id`) REFERENCES `new_articles` (`id`), + CONSTRAINT `koin_notice_ibfk_2` FOREIGN KEY (`admin_id`) REFERENCES `admins` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `lands` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'lands 고유 id', + `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci NOT NULL COMMENT '건물 이름', + `internal_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci NOT NULL COMMENT '건물 이름 소문자 변환 및 띄어쓰기 제거', + `size` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '방 크기', + `room_type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '원룸 종류', + `latitude` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '위도', + `longitude` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '경도', + `phone` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '전화번호', + `image_urls` text CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci COMMENT '이미지 링크', + `address` text CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci COMMENT '주소', + `description` text CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci COMMENT '세부 사항', + `floor` int unsigned DEFAULT NULL COMMENT '층 수', + `deposit` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '보증금', + `monthly_fee` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '월세', + `charter_fee` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '전세', + `management_fee` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '관리비', + `opt_refrigerator` tinyint(1) NOT NULL DEFAULT '0' COMMENT '냉장고 보유 여부', + `opt_closet` tinyint(1) NOT NULL DEFAULT '0' COMMENT '옷장 보유 여부', + `opt_tv` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'tv 보유 여부', + `opt_microwave` tinyint(1) NOT NULL DEFAULT '0' COMMENT '전자레인지 보유 여부', + `opt_gas_range` tinyint(1) NOT NULL DEFAULT '0' COMMENT '가스레인지 보유 여부', + `opt_induction` tinyint(1) NOT NULL DEFAULT '0' COMMENT '인덕션 보유 여부', + `opt_water_purifier` tinyint(1) NOT NULL DEFAULT '0' COMMENT '정수기 보유 여부', + `opt_air_conditioner` tinyint(1) NOT NULL DEFAULT '0' COMMENT '에어컨 보유 여부', + `opt_washer` tinyint(1) NOT NULL DEFAULT '0' COMMENT '샤워기 보유 여부', + `opt_bed` tinyint(1) NOT NULL DEFAULT '0' COMMENT '침대 보유 여부', + `opt_desk` tinyint(1) NOT NULL DEFAULT '0' COMMENT '책상 보유 여부', + `opt_shoe_closet` tinyint(1) NOT NULL DEFAULT '0' COMMENT '신발장 보유 여부', + `opt_electronic_door_locks` tinyint(1) NOT NULL DEFAULT '0' COMMENT '전자 도어락 보유 여부', + `opt_bidet` tinyint(1) NOT NULL DEFAULT '0' COMMENT '비데 보유 여부', + `opt_veranda` tinyint(1) NOT NULL DEFAULT '0' COMMENT '베란다 보유 여부', + `opt_elevator` tinyint(1) NOT NULL DEFAULT '0' COMMENT '엘레베이터 보유 여부', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`), + UNIQUE KEY `ux_name` (`name`), + KEY `ix_internalname` (`internal_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci; + +CREATE TABLE `lectures` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'lectures 고유 id', + `semester_date` varchar(10) NOT NULL, + `code` varchar(10) NOT NULL COMMENT '강의 코드', + `name` varchar(50) NOT NULL COMMENT '강의 이름', + `grades` varchar(2) NOT NULL COMMENT '대상 학년', + `class` varchar(3) NOT NULL COMMENT '강의 분반', + `regular_number` varchar(4) NOT NULL COMMENT '수강 인원', + `department` varchar(30) NOT NULL COMMENT '강의 학과', + `target` varchar(200) NOT NULL, + `professor` varchar(30) DEFAULT NULL, + `is_english` varchar(2) NOT NULL COMMENT '영어강의 여부', + `design_score` varchar(2) NOT NULL COMMENT '설계 학점', + `is_elearning` varchar(2) NOT NULL COMMENT '이러닝 여부', + `class_time` varchar(255) NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`), + KEY `idx_lecture_semester_code` (`semester_date`,`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; + +CREATE TABLE `lost_item_articles` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 id', + `article_id` int unsigned NOT NULL COMMENT '게시글 id', + `author_id` int unsigned DEFAULT NULL COMMENT '작성자 id', + `category` varchar(255) NOT NULL COMMENT '분실물 카테고리', + `found_place` varchar(255) NOT NULL COMMENT '습득 장소', + `found_date` date NOT NULL COMMENT '습득 날짜', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '게시글 삭제 여부', + `is_found` tinyint(1) NOT NULL DEFAULT '0' COMMENT '분실물 찾음 여부', + `found_at` timestamp NULL DEFAULT NULL COMMENT '분실물 찾은 시각', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + `type` varchar(100) NOT NULL DEFAULT 'LOST' COMMENT '게시글 타입', + `is_council` tinyint(1) NOT NULL DEFAULT '0' COMMENT '작성자 총학생회 여부', + PRIMARY KEY (`id`), + KEY `lost_item_article_fk_id` (`article_id`), + KEY `lost_item_article_author_fk_id` (`author_id`), + CONSTRAINT `lost_item_article_author_fk_id` FOREIGN KEY (`author_id`) REFERENCES `users` (`id`) ON DELETE SET NULL, + CONSTRAINT `lost_item_article_fk_id` FOREIGN KEY (`article_id`) REFERENCES `new_articles` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `lost_item_images` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 id', + `lost_item_id` int unsigned NOT NULL COMMENT '분실물 게시글 id', + `image_url` varchar(255) NOT NULL COMMENT '분실물 이미지 url', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '게시글 삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + KEY `lost_item_image_fk_id` (`lost_item_id`), + CONSTRAINT `lost_item_image_fk_id` FOREIGN KEY (`lost_item_id`) REFERENCES `lost_item_articles` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `lost_item_reports` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `lost_id` int unsigned NOT NULL, + `title` varchar(50) NOT NULL, + `content` varchar(255) NOT NULL, + `user_id` int unsigned NOT NULL, + `status` varchar(25) DEFAULT 'UNHANDLED', + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `lost_id` (`lost_id`), + KEY `user_id` (`user_id`), + CONSTRAINT `lost_item_reports_ibfk_1` FOREIGN KEY (`lost_id`) REFERENCES `lost_item_articles` (`id`) ON DELETE CASCADE, + CONSTRAINT `lost_item_reports_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `major` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 id', + `name` varchar(255) DEFAULT NULL COMMENT '전공 이름', + `department_id` int unsigned NOT NULL COMMENT '학과 id', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + UNIQUE KEY `unique_name_department` (`name`,`department_id`), + KEY `department_id` (`department_id`), + CONSTRAINT `major_ibfk_1` FOREIGN KEY (`department_id`) REFERENCES `department` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `members` ( + `id` int NOT NULL AUTO_INCREMENT COMMENT 'members 고유 id', + `name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8_bin NOT NULL COMMENT '이름', + `student_number` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_bin DEFAULT NULL COMMENT '학번', + `track_id` int unsigned NOT NULL COMMENT '소속 트랙 고유 id', + `position` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_bin NOT NULL COMMENT '직급', + `email` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8_bin DEFAULT NULL COMMENT '이메일', + `image_url` text CHARACTER SET utf8mb3 COLLATE utf8_bin COMMENT '이미지 링크', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin; + +CREATE TABLE `migrations` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `migration` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci NOT NULL, + `batch` int NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci; + +CREATE TABLE `new_articles` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'notice articles 고유 id', + `board_id` int unsigned NOT NULL COMMENT '게시판 고유 id', + `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '제목', + `content` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '내용', + `hit` int unsigned NOT NULL DEFAULT '0' COMMENT '조회수', + `is_notice` tinyint(1) NOT NULL DEFAULT '0' COMMENT '공지사항인지 여부', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`), + KEY `FK_ARTICLES_ON_BOARD_ID_idx` (`board_id`), + KEY `idx_articles_deleted_notice` (`is_deleted`,`is_notice`), + FULLTEXT KEY `idx_fulltext_title` (`title`) /*!50100 WITH PARSER `ngram` */ , + CONSTRAINT `FK_ARTICLES_ON_BOARD_ID` FOREIGN KEY (`board_id`) REFERENCES `boards` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `new_koin_articles` ( + `id` int NOT NULL AUTO_INCREMENT, + `article_id` int unsigned NOT NULL, + `user_id` int unsigned DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`), + UNIQUE KEY `article_id_UNIQUE` (`article_id`), + KEY `FK_KOIN_ARTICLES_ON_ARTICLE_ID_idx` (`article_id`), + CONSTRAINT `FK_KOIN_ARTICLES_ON_ARTICLE_ID` FOREIGN KEY (`article_id`) REFERENCES `new_articles` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `new_koreatech_articles` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'notice articles 고유 id', + `article_id` int unsigned NOT NULL, + `author` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '작성자', + `portal_num` int unsigned NOT NULL COMMENT '게시물 번호', + `portal_hit` int unsigned NOT NULL DEFAULT '0', + `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '기존 게시글 url', + `registered_at` datetime DEFAULT NULL COMMENT '등록 일자', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`), + UNIQUE KEY `article_id_UNIQUE` (`article_id`), + KEY `FK_KOREATECH_ARTICLES_ON_ARTICLE_ID_idx` (`article_id`), + CONSTRAINT `FK_KOREATECH_ARTICLES_ON_ARTICLE_ID` FOREIGN KEY (`article_id`) REFERENCES `new_articles` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `notification` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '고유 id', + `app_path` varchar(255) DEFAULT NULL COMMENT '앱 url', + `title` varchar(255) DEFAULT NULL COMMENT '제목', + `message` varchar(255) DEFAULT NULL COMMENT '메시지 내용', + `image_url` varchar(255) DEFAULT NULL COMMENT '이미지 url', + `type` varchar(255) DEFAULT NULL COMMENT '알림 타입', + `users_id` int unsigned NOT NULL COMMENT '유저 id', + `is_read` tinyint(1) NOT NULL COMMENT '읽음 여부', + `created_at` timestamp NOT NULL COMMENT '생성 일자', + `updated_at` timestamp NOT NULL COMMENT '수정 일자', + `scheme_uri` varchar(255) DEFAULT NULL, + `is_push_success` tinyint(1) DEFAULT NULL COMMENT 'FCM 전송 성공 여부', + `fcm_error_code` varchar(100) DEFAULT NULL COMMENT 'FCM 에러 코드', + `fcm_messaging_error_code` varchar(100) DEFAULT NULL COMMENT 'FCM 메시징 에러 코드', + PRIMARY KEY (`id`), + KEY `FK_NOTIFICATION_ON_USER FOREIGN KEY` (`users_id`), + CONSTRAINT `FK_NOTIFICATION_ON_USER FOREIGN KEY` FOREIGN KEY (`users_id`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `notification_subscribe` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `created_at` timestamp NOT NULL COMMENT '생성 일자', + `updated_at` timestamp NOT NULL COMMENT '수정 일자', + `subscribe_type` varchar(255) NOT NULL, + `user_id` int unsigned NOT NULL, + `detail_type` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_user_id_subscribe_type_detail_type` (`user_id`,`subscribe_type`,`detail_type`), + CONSTRAINT `FK_NOTIFICATION_SUBSCRIBE_ON_USER` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `order` ( + `id` varchar(64) NOT NULL COMMENT '주문 ID', + `order_type` varchar(10) NOT NULL COMMENT '주문 타입', + `phone_number` varchar(20) NOT NULL COMMENT '주문자 전화번호', + `total_product_price` int unsigned DEFAULT NULL COMMENT '상품 총 금액', + `total_price` int unsigned DEFAULT NULL COMMENT '주문 총 금액', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `orderable_shop_id` int unsigned DEFAULT NULL COMMENT '주문한 상점 ID', + `user_id` int unsigned DEFAULT NULL COMMENT '주문자 사용자 ID', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', + PRIMARY KEY (`id`), + KEY `idx_user_id` (`user_id`), + KEY `idx_orderable_shop_id` (`orderable_shop_id`), + CONSTRAINT `fk_order_shop` FOREIGN KEY (`orderable_shop_id`) REFERENCES `orderable_shop` (`id`), + CONSTRAINT `fk_order_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `order_delivery` ( + `order_id` varchar(64) NOT NULL COMMENT '주문 ID', + `address` varchar(100) NOT NULL COMMENT '배달 주소', + `to_owner` varchar(50) DEFAULT NULL COMMENT '사장님 전달 메시지', + `to_rider` varchar(50) DEFAULT NULL COMMENT '라이더 전달 메시지', + `delivery_tip` int unsigned NOT NULL COMMENT '배달비', + `provide_cutlery` tinyint(1) NOT NULL DEFAULT '0' COMMENT '수저, 포크 수령 여부', + PRIMARY KEY (`order_id`), + CONSTRAINT `fk_order_delivery_order` FOREIGN KEY (`order_id`) REFERENCES `order` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `order_delivery_v2` ( + `order_id` int unsigned NOT NULL COMMENT '주문 ID', + `address` text NOT NULL COMMENT '배달 주소', + `address_detail` text COMMENT '배달 상세 주소', + `latitude` decimal(10,8) DEFAULT NULL COMMENT '위도', + `longitude` decimal(11,8) DEFAULT NULL COMMENT '경도', + `to_owner` varchar(50) NOT NULL COMMENT '사장님 전달 메시지', + `to_rider` varchar(50) NOT NULL COMMENT '라이더 전달 메시지', + `delivery_tip` int unsigned NOT NULL COMMENT '배달비', + `provide_cutlery` tinyint(1) NOT NULL DEFAULT '0' COMMENT '수저, 포크 수령 여부', + `dispatched_at` timestamp NULL DEFAULT NULL COMMENT '배달 출발 일시', + `completed_at` timestamp NULL DEFAULT NULL COMMENT '배달 완료 일시', + `estimated_arrival_at` timestamp NULL DEFAULT NULL COMMENT '배달 완료 예상 일시', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', + PRIMARY KEY (`order_id`), + CONSTRAINT `fk_order_delivery_order_v2` FOREIGN KEY (`order_id`) REFERENCES `order_v2` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `order_menu` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '주문 메뉴 ID', + `menu_name` varchar(255) NOT NULL COMMENT '메뉴 이름', + `menu_option_name` varchar(255) DEFAULT NULL COMMENT '메뉴 옵션 이름', + `menu_price` int unsigned NOT NULL COMMENT '메뉴 금액', + `quantity` int unsigned NOT NULL COMMENT '수량', + `order_id` varchar(64) NOT NULL COMMENT '주문 ID', + `menu_price_name` varchar(255) DEFAULT NULL COMMENT '메뉴 가격 이름', + PRIMARY KEY (`id`), + KEY `fk_order_menu_order` (`order_id`), + CONSTRAINT `fk_order_menu_order` FOREIGN KEY (`order_id`) REFERENCES `order` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `order_menu_option` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '메뉴 옵션 ID', + `option_name` varchar(255) NOT NULL COMMENT '옵션 이름', + `option_price` int unsigned NOT NULL COMMENT '옵션 가격', + `quantity` int unsigned NOT NULL COMMENT '옵션 수량', + `order_menu_id` int unsigned NOT NULL COMMENT '주문 메뉴 ID', + `option_group_name` varchar(255) NOT NULL COMMENT '주문 메뉴 옵션 이름', + PRIMARY KEY (`id`), + KEY `fk_order_menu_option_menu` (`order_menu_id`), + CONSTRAINT `fk_order_menu_option_menu` FOREIGN KEY (`order_menu_id`) REFERENCES `order_menu` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `order_menu_option_v2` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '메뉴 옵션 ID', + `order_menu_id` int unsigned NOT NULL COMMENT '주문 상점 메뉴 ID', + `orderable_shop_menu_option_group_id` int unsigned NOT NULL COMMENT '주문 가능 상점 메뉴 옵션 그룹 ID', + `orderable_shop_menu_option_id` int unsigned NOT NULL COMMENT '주문 가능 상점 메뉴 옵션 ID', + `group_name` varchar(255) NOT NULL COMMENT '그룹 이름', + `name` varchar(255) NOT NULL COMMENT '옵션 이름', + `price` int unsigned NOT NULL COMMENT '옵션 가격', + `quantity` int unsigned NOT NULL COMMENT '옵션 수량', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', + PRIMARY KEY (`id`), + KEY `fk_order_menu_option_menu_v2` (`order_menu_id`), + CONSTRAINT `fk_order_menu_option_menu_v2` FOREIGN KEY (`order_menu_id`) REFERENCES `order_menu_v2` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `order_menu_v2` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '주문 메뉴 ID', + `order_id` int unsigned NOT NULL COMMENT '주문 ID', + `orderable_shop_menu_id` int unsigned NOT NULL COMMENT '주문 가능 상점 메뉴 ID', + `orderable_shop_menu_price_id` int unsigned NOT NULL COMMENT '주문 가능 상점 메뉴 가격 ID', + `name` varchar(255) NOT NULL COMMENT '메뉴 이름', + `price_name` varchar(255) DEFAULT NULL COMMENT '가격 이름', + `price` int unsigned NOT NULL COMMENT '가격', + `quantity` int unsigned NOT NULL COMMENT '수량', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', + PRIMARY KEY (`id`), + KEY `fk_order_menu_order_v2` (`order_id`), + CONSTRAINT `fk_order_menu_order_v2` FOREIGN KEY (`order_id`) REFERENCES `order_v2` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `order_takeout` ( + `order_id` varchar(64) NOT NULL COMMENT '주문 ID', + `to_owner` varchar(50) DEFAULT NULL COMMENT '사장님 전달 메시지', + `provide_cutlery` tinyint(1) NOT NULL DEFAULT '0' COMMENT '수저, 포크 수령 여부', + PRIMARY KEY (`order_id`), + CONSTRAINT `fk_order_pack_order` FOREIGN KEY (`order_id`) REFERENCES `order` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `order_takeout_v2` ( + `order_id` int unsigned NOT NULL COMMENT '주문 ID', + `to_owner` varchar(50) NOT NULL COMMENT '사장님 전달 메시지', + `provide_cutlery` tinyint(1) NOT NULL DEFAULT '0' COMMENT '수저, 포크 수령 여부', + `packaged_at` timestamp NULL DEFAULT NULL COMMENT '표장 완료 일시', + `estimated_packaged_at` timestamp NULL DEFAULT NULL COMMENT '표장 완료 예상 일시', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', + PRIMARY KEY (`order_id`), + CONSTRAINT `fk_order_takeout_order_v2` FOREIGN KEY (`order_id`) REFERENCES `order_v2` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `order_v2` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '주문 고유 ID', + `pg_order_id` varchar(64) NOT NULL COMMENT 'PG 주문 ID', + `user_id` int unsigned NOT NULL COMMENT '유저 고유 ID', + `phone_number` varchar(20) NOT NULL COMMENT '전화번호', + `orderable_shop_id` int unsigned NOT NULL COMMENT '주문 가능 상점 ID', + `orderable_shop_name` varchar(255) NOT NULL COMMENT '주문 가능 상점 이름', + `orderable_shop_address` text NOT NULL COMMENT '주문 가능 상점 주소', + `orderable_shop_address_detail` text COMMENT '주문 가능 상점 상세 주소', + `total_product_price` int unsigned NOT NULL COMMENT '상품 총 금액', + `discount_amount` int unsigned NOT NULL DEFAULT '0' COMMENT '할인 금액', + `total_price` int unsigned NOT NULL COMMENT '주문 총 금액', + `order_type` varchar(10) NOT NULL COMMENT '주문 타입', + `status` varchar(10) NOT NULL COMMENT '주문 상태', + `canceled_at` timestamp NULL DEFAULT NULL COMMENT '취소 일시', + `canceled_reason` varchar(200) DEFAULT NULL COMMENT '취소 사유', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `orderable_shop` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `shop_id` int unsigned NOT NULL COMMENT '상점 ID', + `delivery` tinyint(1) NOT NULL DEFAULT '1' COMMENT '배달 가능 여부', + `takeout` tinyint(1) NOT NULL DEFAULT '1' COMMENT '포장 가능 여부', + `service_event` tinyint(1) NOT NULL DEFAULT '0' COMMENT '서비스 증정 여부', + `minimum_order_amount` int unsigned NOT NULL COMMENT '최소 주문 금액', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + UNIQUE KEY `shop_id` (`shop_id`), + KEY `idx_orderable_shop_shop_id` (`shop_id`), + KEY `idx_orderable_shop_minimum_order_amount` (`minimum_order_amount`,`shop_id`), + KEY `idx_orderable_shop_filter_01` (`delivery`,`takeout`,`shop_id`), + KEY `idx_orderable_shop_filter_02` (`minimum_order_amount`,`delivery`,`takeout`,`shop_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `orderable_shop_delivery_option` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', + `orderable_shop_id` int unsigned NOT NULL COMMENT '주문 가능 상점 ID', + `campus_delivery` tinyint(1) NOT NULL DEFAULT '1' COMMENT '교내 배달 가능 여부', + `off_campus_delivery` tinyint(1) NOT NULL DEFAULT '1' COMMENT '교외 배달 가능 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `orderable_shop_image` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `orderable_shop_id` int unsigned NOT NULL COMMENT '주문 가능 상점 ID', + `image_url` varchar(255) NOT NULL COMMENT '이미지 URL', + `is_thumbnail` tinyint(1) NOT NULL DEFAULT '0' COMMENT '대표 이미지 여부', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + KEY `idx_images_on_orderable_shop_id` (`orderable_shop_id`), + KEY `idx_thumbnail_images` (`orderable_shop_id`,`is_thumbnail`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `orderable_shop_menu` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `orderable_shop_id` int unsigned NOT NULL COMMENT '주문 가능한 상점 ID', + `name` varchar(255) NOT NULL COMMENT '메뉴 이름', + `description` text COMMENT '메뉴 설명', + `is_sold_out` tinyint(1) NOT NULL DEFAULT '0' COMMENT '품절 여부', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + KEY `idx_orderable_shop_menu_orderable_shop_id` (`orderable_shop_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `orderable_shop_menu_group` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `orderable_shop_id` int unsigned NOT NULL COMMENT '주문 가능 상점 ID', + `name` varchar(255) NOT NULL COMMENT '메뉴 그룹 이름', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + KEY `idx_orderable_shop_id` (`orderable_shop_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `orderable_shop_menu_group_map` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `orderable_shop_menu_group_id` int unsigned NOT NULL COMMENT '주문 가능 메뉴 그룹 ID', + `orderable_shop_menu_id` int unsigned NOT NULL COMMENT '주문 가능 메뉴 ID', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + KEY `idx_map_on_menu_group_id` (`orderable_shop_menu_group_id`), + KEY `idx_map_on_menu_id` (`orderable_shop_menu_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `orderable_shop_menu_images` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `orderable_shop_menu_id` int unsigned NOT NULL COMMENT '주문 가능 메뉴 ID', + `image_url` varchar(255) NOT NULL COMMENT '이미지 URL', + `is_thumbnail` tinyint(1) NOT NULL DEFAULT '0' COMMENT '대표 이미지 여부', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + KEY `idx_images_on_menu_id` (`orderable_shop_menu_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `orderable_shop_menu_option` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `orderable_shop_menu_option_group_id` int unsigned NOT NULL COMMENT '옵션 그룹 ID', + `name` varchar(255) NOT NULL COMMENT '옵션 이름 (ex: 순한맛, 콜라)', + `price` int unsigned NOT NULL COMMENT '추가 가격', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + KEY `idx_option_on_option_group_id` (`orderable_shop_menu_option_group_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `orderable_shop_menu_option_group` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `orderable_shop_id` int unsigned NOT NULL COMMENT '주문 가능한 상점 ID', + `name` varchar(255) NOT NULL COMMENT '옵션 그룹 이름 (ex: 맛, 음료 등)', + `description` text COMMENT '옵션 그룹 설명', + `is_required` tinyint(1) NOT NULL DEFAULT '0' COMMENT '필수 옵션 여부', + `min_select` int unsigned NOT NULL DEFAULT '0' COMMENT '최소 선택 개수', + `max_select` int unsigned DEFAULT NULL COMMENT '최대 선택 개수', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + KEY `idx_orderable_shop_id` (`orderable_shop_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `orderable_shop_menu_option_group_map` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `orderable_shop_menu_option_group_id` int unsigned NOT NULL COMMENT '옵션 그룹 ID', + `orderable_shop_menu_id` int unsigned NOT NULL COMMENT '메뉴 ID', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + KEY `idx_map_on_option_group_id` (`orderable_shop_menu_option_group_id`), + KEY `idx_map_on_menu_id` (`orderable_shop_menu_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `orderable_shop_menu_price` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `orderable_shop_menu_id` int unsigned NOT NULL COMMENT '메뉴 ID', + `name` varchar(255) DEFAULT NULL COMMENT '가격 옵션 이름 (ex: 대, 중, 소)', + `price` int unsigned NOT NULL COMMENT '가격', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + KEY `idx_price_on_menu_id` (`orderable_shop_menu_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `organizations` ( + `id` int NOT NULL AUTO_INCREMENT, + `user_id` int NOT NULL COMMENT '단체 계정 user_id', + `name` varchar(100) NOT NULL COMMENT '단체명 (예: 총학생회, 컴퓨터공학부)', + `location` varchar(255) NOT NULL COMMENT '방문 장소 (예: 학생회관 320호 총학생회 사무실)', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `uk_organizations_user_id` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='단체 정보'; + +CREATE TABLE `owner_attachments` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `owner_id` int unsigned NOT NULL, + `url` text CHARACTER SET utf8mb3 COLLATE utf8_bin NOT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `owner_shop_attachment_fk_owner_id` (`owner_id`), + CONSTRAINT `owner_shop_attachment_fk_owner_id` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin; + +CREATE TABLE `owners` ( + `user_id` int NOT NULL COMMENT 'user 고유 id', + `company_registration_number` varchar(12) CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL, + `grant_shop` tinyint DEFAULT '0' COMMENT '상점 수정 권한', + `grant_event` tinyint DEFAULT '0' COMMENT '이벤트 수정 권한', + `account` varchar(11) CHARACTER SET utf8mb3 COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`user_id`), + UNIQUE KEY `company_registration_number_UNIQUE` (`company_registration_number`), + UNIQUE KEY `account_UNIQUE` (`account`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin; + +CREATE TABLE `password_resets` ( + `email` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci NOT NULL, + `token` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci NOT NULL, + `created_at` timestamp NULL DEFAULT NULL, + KEY `password_resets_email_index` (`email`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci; + +CREATE TABLE `payment` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `payment_key` varchar(200) NOT NULL COMMENT '결제 키', + `amount` int unsigned NOT NULL COMMENT '결제 금액', + `status` varchar(30) NOT NULL COMMENT '결제 상태', + `method` varchar(30) NOT NULL COMMENT '결제 수단', + `requested_at` timestamp NOT NULL COMMENT '결제 요청 일시', + `approved_at` timestamp NOT NULL COMMENT '결제 승인 일시', + `order_id` varchar(64) NOT NULL COMMENT '주문 번호', + PRIMARY KEY (`id`), + UNIQUE KEY `uq_payment_key` (`id`), + KEY `fk_payment_order` (`order_id`), + CONSTRAINT `fk_payment_order` FOREIGN KEY (`order_id`) REFERENCES `order` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `payment_cancel` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '결제 취소 ID', + `transaction_key` varchar(64) NOT NULL COMMENT '취소 트랜잭션 키', + `cancel_reason` varchar(200) NOT NULL COMMENT '취소 사유', + `cancel_amount` int unsigned NOT NULL COMMENT '취소 금액', + `canceled_at` timestamp NOT NULL COMMENT '취소 일시', + `payment_id` int unsigned NOT NULL COMMENT '결제 ID', + PRIMARY KEY (`id`), + KEY `fk_payment_cancel_payment` (`payment_id`), + CONSTRAINT `fk_payment_cancel_payment` FOREIGN KEY (`payment_id`) REFERENCES `payment` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `payment_cancel_v2` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '결제 취소 ID', + `payment_id` int unsigned NOT NULL COMMENT '결제 ID', + `transaction_key` varchar(64) NOT NULL COMMENT '취소 트랜잭션 키', + `reason` varchar(200) NOT NULL COMMENT '취소 사유', + `amount` int unsigned NOT NULL COMMENT '취소 금액', + `canceled_at` timestamp NOT NULL COMMENT '취소 일시', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', + PRIMARY KEY (`id`), + KEY `fk_payment_cancel_payment_v2` (`payment_id`), + CONSTRAINT `fk_payment_cancel_payment_v2` FOREIGN KEY (`payment_id`) REFERENCES `payment_v2` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `payment_idempotency_key` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '결제 멱등키 ID', + `user_id` int unsigned NOT NULL COMMENT '유저 ID', + `idempotency_key` varchar(300) NOT NULL COMMENT '결제 멱등키', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_idempotency_key_user_id` (`user_id`), + CONSTRAINT `fk_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `payment_v2` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `order_id` int unsigned NOT NULL COMMENT '주문 번호', + `payment_key` varchar(200) NOT NULL COMMENT '결제 키', + `amount` int unsigned NOT NULL COMMENT '결제 금액', + `status` varchar(30) NOT NULL COMMENT '결제 상태', + `method` varchar(30) NOT NULL COMMENT '결제 수단', + `description` varchar(255) NOT NULL COMMENT '결제 설명', + `easy_pay_company` varchar(255) DEFAULT NULL COMMENT '간편 결제사', + `requested_at` timestamp NOT NULL COMMENT '결제 요청 일시', + `approved_at` timestamp NOT NULL COMMENT '결제 승인 일시', + `receipt` text NOT NULL COMMENT '영수증', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', + PRIMARY KEY (`id`), + UNIQUE KEY `uq_payment_key` (`id`), + KEY `fk_payment_order_v2` (`order_id`), + CONSTRAINT `fk_payment_order_v2` FOREIGN KEY (`order_id`) REFERENCES `order_v2` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `rider_message` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '배달 기사 요청 사항 고유 ID', + `content` varchar(100) NOT NULL COMMENT '배달 기사 요청 사항', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `search_articles` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'search articles 고유 id', + `table_id` int unsigned NOT NULL COMMENT '게시판(table) 고유 id', + `article_id` int unsigned NOT NULL COMMENT 'article(게시글) 고유 id', + `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_bin NOT NULL COMMENT '게시글 제목', + `content` text CHARACTER SET utf8mb3 COLLATE utf8_bin COMMENT '게시글 내용', + `user_id` int unsigned DEFAULT NULL COMMENT 'user 고유 id', + `nickname` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8_bin NOT NULL COMMENT '닉네임', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`), + UNIQUE KEY `pk` (`id`), + UNIQUE KEY `idx_unique` (`table_id`,`article_id`), + KEY `idx_timestamp` (`created_at`), + KEY `idx_is_deleted` (`is_deleted`), + KEY `idx_nickname` (`nickname`,`is_deleted`,`created_at`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin; + +CREATE TABLE `semester` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `semester` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8_bin NOT NULL COMMENT '학기', + `year` int unsigned NOT NULL, + `term` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `semester_UNIQUE` (`semester`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin; + +CREATE TABLE `shop_base_delivery_tip` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `shop_id` int unsigned NOT NULL COMMENT '상점 ID', + `order_amount` int NOT NULL COMMENT '주문 금액 기준', + `fee` int NOT NULL COMMENT '배달비', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + KEY `idx_shop_base_delivery_tip_shop_id` (`shop_id`), + KEY `idx_shop_base_delivery_tip_01` (`shop_id`,`order_amount`,`fee`), + KEY `idx_shop_base_delivery_tip_02` (`shop_id`,`is_deleted`,`fee`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `shop_benefit_categories` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `title` varchar(60) NOT NULL, + `detail` varchar(255) DEFAULT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `on_image_url` varchar(255) NOT NULL, + `off_image_url` varchar(255) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `shop_benefit_category_map` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `shop_id` int unsigned NOT NULL, + `benefit_id` int unsigned NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `detail` varchar(20) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `shop_id` (`shop_id`), + KEY `benefit_id` (`benefit_id`), + CONSTRAINT `shop_benefit_category_map_ibfk_1` FOREIGN KEY (`shop_id`) REFERENCES `shops` (`id`), + CONSTRAINT `shop_benefit_category_map_ibfk_2` FOREIGN KEY (`benefit_id`) REFERENCES `shop_benefit_categories` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `shop_categories` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'shop_categories 고유 id', + `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_bin NOT NULL COMMENT '카테고리 이름', + `image_url` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_bin DEFAULT NULL COMMENT '이미지 URL', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + `parent_category_id` int unsigned DEFAULT NULL COMMENT '상위 카테고리 id', + `event_banner_image_url` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_bin DEFAULT NULL COMMENT '이벤트 배너 이미지', + `order_index` int NOT NULL, + PRIMARY KEY (`id`), + KEY `FK_SHOP_CATEGORIES_ON_SHOP_PARENT_CATEGORIES` (`parent_category_id`), + CONSTRAINT `FK_SHOP_CATEGORIES_ON_SHOP_PARENT_CATEGORIES` FOREIGN KEY (`parent_category_id`) REFERENCES `shop_parent_categories` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin; + +CREATE TABLE `shop_category_map` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'shop_category_map 고유 id', + `shop_id` int unsigned NOT NULL COMMENT 'shops 고유 id', + `shop_category_id` int unsigned NOT NULL COMMENT 'shop_categories 고유 id', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`), + UNIQUE KEY `SHOP_ID_AND_SHOP_CATEGORY_ID` (`shop_id`,`shop_category_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin; + +CREATE TABLE `shop_images` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'shop_images 고유 id', + `shop_id` int unsigned NOT NULL COMMENT 'shops 고유 id', + `image_url` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_bin DEFAULT NULL COMMENT '이미지 URL', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`), + UNIQUE KEY `SHOP_ID_AND_IMAGE_URL` (`shop_id`,`image_url`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin; + +CREATE TABLE `shop_menu_categories` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'shop_menu_categories 고유 id', + `shop_id` int unsigned NOT NULL COMMENT 'shops 고유 id', + `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_bin NOT NULL COMMENT '카테고리 이름', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin; + +CREATE TABLE `shop_menu_category_map` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'shop_menu_category_map 고유 id', + `shop_menu_id` int unsigned NOT NULL COMMENT 'shop_menus 고유 id', + `shop_menu_category_id` int unsigned NOT NULL COMMENT 'shop_menu_categories 고유 id', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`), + UNIQUE KEY `SHOP_MENU_ID_AND_SHOP_MENU_CATEGORY_ID` (`shop_menu_id`,`shop_menu_category_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin; + +CREATE TABLE `shop_menu_details` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'shop_menu_details 고유 id', + `shop_menu_id` int unsigned NOT NULL COMMENT 'shop_menus 고유 id', + `option` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_bin DEFAULT NULL COMMENT '옵션 이름', + `price` int unsigned NOT NULL COMMENT '가격', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`), + UNIQUE KEY `SHOP_MENU_ID_AND_OPTION_AND_PRICE` (`shop_menu_id`,`option`,`price`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin; + +CREATE TABLE `shop_menu_images` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'shop_menu_images 고유 id', + `shop_menu_id` int unsigned NOT NULL COMMENT 'shop_menus 고유 id', + `image_url` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_bin NOT NULL COMMENT '이미지 URL', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`), + UNIQUE KEY `SHOP_MENU_ID_AND_IMAGE_URL` (`shop_menu_id`,`image_url`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin; + +CREATE TABLE `shop_menu_origin` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `shop_id` int unsigned NOT NULL COMMENT '상점 ID', + `ingredient` varchar(50) DEFAULT NULL, + `origin` varchar(50) DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + KEY `idx_shop_menu_origin_shop_id` (`shop_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `shop_menu_search_keywords` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `keyword` varchar(255) NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `shop_menus` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'shop_menus 고유 id', + `shop_id` int unsigned NOT NULL COMMENT 'shop 고유 id', + `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci NOT NULL COMMENT '메뉴 이름', + `description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '메뉴 구성', + `is_hidden` tinyint(1) NOT NULL DEFAULT '0' COMMENT '숨김 여부', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci; + +CREATE TABLE `shop_notification_messages` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'shop_notification_messages 고유 id', + `title` varchar(255) NOT NULL COMMENT '메세지 제목', + `content` varchar(255) NOT NULL COMMENT '메세지 내용', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `shop_opens` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'shop_open 고유 id', + `shop_id` int unsigned NOT NULL COMMENT 'shops 고유 id', + `day_of_week` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8_bin NOT NULL COMMENT '요일', + `closed` tinyint(1) NOT NULL COMMENT '휴무 여부', + `open_time` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8_bin DEFAULT NULL COMMENT '오픈 시간', + `close_time` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8_bin DEFAULT NULL COMMENT '마감 시간', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`), + KEY `shop_opens_filter` (`day_of_week`,`shop_id`,`open_time`,`close_time`), + KEY `shop_opens_shop_id` (`shop_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin; + +CREATE TABLE `shop_operation` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `shop_id` int unsigned NOT NULL COMMENT '상점 ID', + `is_open` tinyint(1) NOT NULL DEFAULT '0' COMMENT '현재 상점 오픈 여부', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + UNIQUE KEY `shop_id` (`shop_id`), + KEY `idx_shop_operation_shop_id` (`shop_id`), + KEY `idx_shop_operation_shop_id_is_open` (`shop_id`,`is_open`), + KEY `idx_shop_operation_shop_id_open_deleted` (`shop_id`,`is_open`,`is_deleted`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `shop_order_service_requests` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 ID', + `shop_id` int unsigned NOT NULL COMMENT '식당 ID', + `minimum_order_amount` int unsigned NOT NULL COMMENT '최소 주문 금액', + `is_takeout` tinyint(1) NOT NULL DEFAULT '0' COMMENT '포장 여부', + `delivery_option` varchar(50) NOT NULL COMMENT '배달 옵션', + `campus_delivery_tip` int unsigned NOT NULL DEFAULT '0' COMMENT '캠퍼스 내 배달 팁', + `off_campus_delivery_tip` int unsigned NOT NULL DEFAULT '0' COMMENT '캠퍼스 외 배달 팁', + `business_license_url` varchar(255) NOT NULL COMMENT '사업자 등록증 URL', + `business_certificate_url` varchar(255) NOT NULL COMMENT '영업 신고증 URL', + `bank_copy_url` varchar(255) NOT NULL COMMENT '통장 사본 URL', + `bank` varchar(10) NOT NULL COMMENT '은행명', + `account_number` varchar(20) NOT NULL COMMENT '계좌 번호', + `request_status` varchar(50) NOT NULL DEFAULT 'PENDING' COMMENT '요청 상태', + `approved_at` timestamp NULL DEFAULT NULL COMMENT '승인 일자', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`), + KEY `fk_shop_order_service_requests_shop_id` (`shop_id`), + CONSTRAINT `fk_shop_order_service_requests_shop_id` FOREIGN KEY (`shop_id`) REFERENCES `shops` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `shop_parent_categories` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'shop_parent_categories 고유 id', + `name` varchar(255) NOT NULL COMMENT '메인 카테고리 이름', + `notification_message_id` int unsigned NOT NULL COMMENT '알림 메시지 id', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + KEY `FK_MAIN_CATEGORIES_ON_SHOP_NOTIFICATION_MESSAGES` (`notification_message_id`), + CONSTRAINT `FK_MAIN_CATEGORIES_ON_SHOP_NOTIFICATION_MESSAGES` FOREIGN KEY (`notification_message_id`) REFERENCES `shop_notification_messages` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `shop_review_images` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `review_id` int unsigned NOT NULL, + `image_urls` text NOT NULL, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `shop_review_images_ibfk_1` (`review_id`), + CONSTRAINT `shop_review_images_ibfk_1` FOREIGN KEY (`review_id`) REFERENCES `shop_reviews` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `shop_review_menus` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `review_id` int unsigned NOT NULL, + `menu_name` text NOT NULL, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `shop_review_menus_ibfk_1` (`review_id`), + CONSTRAINT `shop_review_menus_ibfk_1` FOREIGN KEY (`review_id`) REFERENCES `shop_reviews` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `shop_review_reports` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `review_id` int unsigned NOT NULL, + `title` varchar(50) NOT NULL, + `content` text, + `user_id` int unsigned NOT NULL, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `status` varchar(25) DEFAULT 'UNHANDLED', + PRIMARY KEY (`id`), + KEY `shop_review_reports_ibfk_1` (`review_id`), + KEY `shop_review_reports_ibfk_2` (`user_id`), + CONSTRAINT `shop_review_reports_ibfk_1` FOREIGN KEY (`review_id`) REFERENCES `shop_reviews` (`id`) ON DELETE CASCADE, + CONSTRAINT `shop_review_reports_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `shop_review_reports_categories` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `detail` varchar(255) NOT NULL, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `shop_reviews` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `shop_id` int unsigned NOT NULL, + `content` text NOT NULL, + `rating` int NOT NULL, + `reviewer_id` int unsigned NOT NULL, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `is_deleted` tinyint(1) DEFAULT '0', + PRIMARY KEY (`id`), + KEY `shop_reviews_ibfk_1` (`reviewer_id`), + KEY `shop_reviews_ibfk_2` (`shop_id`), + KEY `shop_reviews_rating` (`shop_id`,`rating`), + KEY `idx_shop_reviews_covering` (`shop_id`,`is_deleted`,`rating`), + CONSTRAINT `shop_reviews_ibfk_1` FOREIGN KEY (`reviewer_id`) REFERENCES `users` (`id`) ON DELETE CASCADE, + CONSTRAINT `shop_reviews_ibfk_2` FOREIGN KEY (`shop_id`) REFERENCES `shops` (`id`) ON DELETE CASCADE, + CONSTRAINT `shop_reviews_chk_1` CHECK ((`rating` between 0 and 5)) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `shops` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'shops 고유 id', + `owner_id` int DEFAULT NULL COMMENT 'owner 고유 id', + `name` varchar(50) NOT NULL COMMENT '가게 이름', + `internal_name` varchar(50) NOT NULL COMMENT '가게 이름을 소문자로 변경하고 띄어쓰기 제거', + `chosung` varchar(3) DEFAULT NULL COMMENT '가게 이름 앞자리 1글자의 초성', + `phone` varchar(50) DEFAULT NULL COMMENT '전화 번호', + `address` text COMMENT '주소', + `address_detail` text COMMENT '상세 주소', + `description` text COMMENT '세부 사항', + `introduction` text COMMENT '가게 소개', + `notice` text COMMENT '가게 알림', + `delivery` tinyint(1) NOT NULL DEFAULT '0' COMMENT '배달 가능 여부', + `delivery_price` int unsigned NOT NULL DEFAULT '0' COMMENT '배달 금액', + `pay_card` tinyint(1) NOT NULL DEFAULT '0' COMMENT '카드 가능 여부', + `pay_bank` tinyint(1) NOT NULL DEFAULT '0' COMMENT '계좌이체 가능 여부', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + `is_event` tinyint(1) NOT NULL DEFAULT '0' COMMENT '이벤트 진행 여부', + `remarks` text COMMENT '이벤트 상세내용 등 부가내용', + `hit` int unsigned NOT NULL DEFAULT '0' COMMENT '조회수', + `bank` varchar(10) DEFAULT NULL, + `account_number` varchar(20) DEFAULT NULL, + `main_category_id` int unsigned DEFAULT NULL COMMENT '메인 카테고리 id', + PRIMARY KEY (`id`), + KEY `ix_internalname` (`internal_name`), + KEY `FK_SHOPS_ON_SHOP_CATEGORIES` (`main_category_id`), + CONSTRAINT `FK_SHOPS_ON_SHOP_CATEGORIES` FOREIGN KEY (`main_category_id`) REFERENCES `shop_categories` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `standard_graduation_requirements` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 id', + `year` varchar(20) NOT NULL COMMENT '년도', + `major_id` int unsigned NOT NULL COMMENT '전공 id', + `course_type_id` int unsigned DEFAULT NULL COMMENT '이수 구분 id', + `required_grades` int NOT NULL COMMENT '기준 학점', + `is_deleted` tinyint DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + KEY `course_type_id` (`course_type_id`), + KEY `major_id` (`major_id`), + CONSTRAINT `standard_graduation_requirements_ibfk_1` FOREIGN KEY (`course_type_id`) REFERENCES `course_type` (`id`), + CONSTRAINT `standard_graduation_requirements_ibfk_2` FOREIGN KEY (`major_id`) REFERENCES `major` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `student_course_calculation` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 id', + `user_id` int unsigned NOT NULL COMMENT '유저 id', + `standard_graduation_requirements_id` int unsigned DEFAULT NULL COMMENT '기준 졸업 요건 id', + `completed_grades` int NOT NULL DEFAULT '0' COMMENT '이수 학점', + `is_deleted` tinyint DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + UNIQUE KEY `unique_user_standard_graduation_requirements` (`user_id`,`standard_graduation_requirements_id`), + KEY `standard_graduation_requirements_id` (`standard_graduation_requirements_id`), + CONSTRAINT `student_course_calculation_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE, + CONSTRAINT `student_course_calculation_ibfk_2` FOREIGN KEY (`standard_graduation_requirements_id`) REFERENCES `standard_graduation_requirements` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `students` ( + `user_id` int NOT NULL COMMENT 'user 고유 id', + `anonymous_nickname` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_bin DEFAULT NULL COMMENT '익명 닉네임', + `student_number` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_bin DEFAULT NULL COMMENT '학번', + `identity` smallint DEFAULT NULL COMMENT '신원(0: 학생, 1: 대학원생)', + `is_graduated` tinyint(1) DEFAULT NULL COMMENT '졸업 여부', + `department_id` int unsigned DEFAULT NULL COMMENT '학과 id', + `major_id` int unsigned DEFAULT NULL, + PRIMARY KEY (`user_id`), + UNIQUE KEY `anonymous_nickname_UNIQUE` (`anonymous_nickname`), + KEY `fk_student_department` (`department_id`), + KEY `fk_student_major` (`major_id`), + CONSTRAINT `fk_student_department` FOREIGN KEY (`department_id`) REFERENCES `department` (`id`), + CONSTRAINT `fk_student_major` FOREIGN KEY (`major_id`) REFERENCES `major` (`id`) ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin; + +CREATE TABLE `tech_stacks` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'tech_stacks 고유 id', + `image_url` text CHARACTER SET utf8mb3 COLLATE utf8_bin COMMENT '이미지 링크', + `name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8_bin NOT NULL COMMENT '기술 스택 명', + `description` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8_bin DEFAULT NULL COMMENT '기술 스택 설명', + `track_id` int unsigned NOT NULL COMMENT 'track 고유 id', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin; + +CREATE TABLE `timetable_frame` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 id', + `user_id` int unsigned NOT NULL COMMENT '유저 id', + `semester_id` int unsigned NOT NULL COMMENT '학기 id', + `name` varchar(255) NOT NULL COMMENT '시간표 이름', + `is_main` tinyint(1) NOT NULL DEFAULT '0' COMMENT '메인 시간표 여부', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '시간표 삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + KEY `timetable_frame_INDEX` (`user_id`,`semester_id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `timetable_lecture` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '고유 id', + `class_title` varchar(255) DEFAULT NULL COMMENT '수업 이름', + `class_time` text, + `class_place` text, + `professor` varchar(255) DEFAULT NULL COMMENT '교수', + `grades` varchar(2) NOT NULL DEFAULT '0' COMMENT '학점', + `memo` varchar(255) DEFAULT NULL COMMENT '메모', + `is_deleted` tinyint(1) DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + `lectures_id` int unsigned DEFAULT NULL COMMENT '강의_id', + `frame_id` int unsigned DEFAULT NULL COMMENT '시간표 프레임 id', + `course_type_id` int unsigned DEFAULT NULL COMMENT '이수구분 id', + `general_education_area_id` int unsigned DEFAULT NULL COMMENT '교양영역 id', + PRIMARY KEY (`id`), + KEY `FK_TIMETABLE_FRAME_ON_TIMETABLE_LECTURE` (`frame_id`), + KEY `FK_COURSE_TYPE_ON_TIMETABLE_LECTURE` (`course_type_id`), + KEY `FK_GENERAL_EDUCATION_AREA_ON_TIMETABLE_LECTURE` (`general_education_area_id`), + CONSTRAINT `FK_COURSE_TYPE_ON_TIMETABLE_LECTURE` FOREIGN KEY (`course_type_id`) REFERENCES `course_type` (`id`) ON DELETE CASCADE, + CONSTRAINT `FK_GENERAL_EDUCATION_AREA_ON_TIMETABLE_LECTURE` FOREIGN KEY (`general_education_area_id`) REFERENCES `general_education_area` (`id`) ON DELETE CASCADE, + CONSTRAINT `FK_TIMETABLE_FRAME_ON_TIMETABLE_LECTURE` FOREIGN KEY (`frame_id`) REFERENCES `timetable_frame` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `tracks` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'tracks 테이블 고유 id', + `name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8_bin NOT NULL COMMENT '트랙명', + `headcount` int unsigned NOT NULL DEFAULT '0' COMMENT '인원수', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin; + +CREATE TABLE `user_delivery_address` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '배달 주소 고유 ID', + `user_id` int unsigned NOT NULL COMMENT '사용자 ID', + `address_type` varchar(20) NOT NULL COMMENT '주소 타입 (CAMPUS, OFF_CAMPUS)', + `campus_delivery_address_id` int unsigned DEFAULT NULL COMMENT '교내 배달 주소 ID', + `zip_number` varchar(10) DEFAULT NULL COMMENT '교외 배달 주소 우편 번호', + `si_do` varchar(50) DEFAULT NULL COMMENT '시/도', + `si_gun_gu` varchar(50) DEFAULT NULL COMMENT '시/군/구', + `eup_myeon_dong` varchar(50) DEFAULT NULL COMMENT '읍/면/동', + `road` varchar(50) DEFAULT NULL COMMENT '도로명', + `building` varchar(50) DEFAULT NULL COMMENT '건물명', + `address` text COMMENT '상세 정보를 제외한 기본 주소', + `detail_address` varchar(100) DEFAULT NULL COMMENT '상세 주소', + `full_address` varchar(255) DEFAULT NULL COMMENT '전체 주소 (도로명/지번)', + `last_used_at` timestamp NULL DEFAULT NULL COMMENT '마지막 사용 시간', + `usage_count` int unsigned DEFAULT '0' COMMENT '사용 횟수', + `is_default` tinyint(1) DEFAULT '0', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', + PRIMARY KEY (`id`), + KEY `idx_user_address` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `user_notification_status` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `user_id` int unsigned NOT NULL, + `last_notified_article_id` int NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `uk_user_id` (`user_id`), + CONSTRAINT `user_notification_status_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `users` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'users 테이블 고유 id', + `password` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '비밀번호', + `nickname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '닉네임', + `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '이름', + `phone_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '휴대 전화 번호', + `user_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '유저 타입(Students or Owners)', + `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '학교 email', + `gender` int unsigned DEFAULT NULL COMMENT '성별', + `is_authed` tinyint(1) NOT NULL DEFAULT '0' COMMENT '인증 여부', + `last_logged_at` timestamp NULL DEFAULT NULL COMMENT '최근 로그인 일자', + `profile_image_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '프로필 이미지 s3 url', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '탈퇴 여부', + `anonymous_nickname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '회원가입 일자(생성 일자)', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + `device_token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `anonymous_nickname` (`anonymous_nickname`), + UNIQUE KEY `anonymous_nickname_2` (`anonymous_nickname`), + UNIQUE KEY `nickname_UNIQUE` (`nickname`), + UNIQUE KEY `uq_users_login_id` (`user_id`), + UNIQUE KEY `uq_users_nickname` (`nickname`), + UNIQUE KEY `uq_users_phone_number` (`phone_number`), + UNIQUE KEY `uq_users_email` (`email`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE `versions` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'versions 테이블 고유 id', + `version` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci NOT NULL COMMENT '버전 명 (예시 : 1.1.0)', + `type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci DEFAULT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성일자', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', + `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '업데이트 문구 제목', + `is_previous` tinyint(1) DEFAULT NULL, + `content` text CHARACTER SET utf8mb3 COLLATE utf8_unicode_ci, + PRIMARY KEY (`id`), + KEY `idx_versions_type_previous` (`type`,`is_previous`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci; + +SET UNIQUE_CHECKS = 1; +SET FOREIGN_KEY_CHECKS = 1; diff --git a/src/main/resources/db/migration/V1__init.sql b/src/main/resources/db/migration/V1__init.sql deleted file mode 100644 index 84b0a56a32..0000000000 --- a/src/main/resources/db/migration/V1__init.sql +++ /dev/null @@ -1,1047 +0,0 @@ -create table if not exists activities -( - id int unsigned auto_increment comment 'activities 고유 id' - primary key, - title varchar(255) not null comment '활동명', - description text null comment '활동 설명', - image_urls text null comment '이미지 링크', - date date not null comment '활동 일자', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자' -) - collate = utf8_bin; - -create table if not exists admins -( - id int unsigned auto_increment comment 'admins 고유 id' - primary key, - user_id int unsigned not null comment '해당 user 고유 id', - grant_user tinyint(1) default 0 not null comment 'user 수정 권한', - grant_callvan tinyint(1) default 0 not null comment '콜벤 수정 권한', - grant_land tinyint(1) default 0 not null comment '복덕방 수정 권한', - grant_community tinyint(1) default 0 not null comment '커뮤니티 수정 권한', - grant_shop tinyint(1) default 0 not null comment '상점 수정 권한', - grant_version tinyint(1) default 0 not null comment '버전 수정 권한', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자', - grant_market tinyint(1) default 0 not null comment '거래 수정 권한', - grant_circle tinyint(1) default 0 not null comment '동아리 수정 권한', - grant_lost tinyint(1) default 0 not null comment '분실물 수정 권한', - grant_survey tinyint(1) default 0 not null comment '조사 수정 구너한', - grant_bcsdlab tinyint(1) default 0 not null comment 'bcsdlab 홈페이지 수정 권한', - grant_event tinyint(1) default 0 not null comment '이벤트 수정 권한', - constraint admins_user_id_unique - unique (user_id) -) - collate = utf8_unicode_ci; - -create table if not exists article_view_logs -( - id int unsigned auto_increment comment 'article view logs 고유 id' - primary key, - article_id int unsigned not null comment 'article 고유 id', - user_id int unsigned null comment '본 사람 user 고유 id', - expired_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '만료 시간', - ip varchar(45) not null comment 'IP 주소', - constraint article_view_logs_article_id_user_id_unique - unique (article_id, user_id) -) - collate = utf8_unicode_ci; - -create table if not exists articles -( - id int unsigned auto_increment comment 'articlees 고유 id' - primary key, - board_id int unsigned not null comment '게시판의 고유 id', - title varchar(255) not null comment '제목', - content mediumtext not null comment '내용', - user_id int unsigned not null comment '작성자 user 고유 id', - nickname varchar(50) not null comment '작성자 user 닉네임', - hit int unsigned default 0 not null comment '조회수', - ip varchar(45) not null comment 'IP 주소', - is_solved tinyint(1) default 0 not null comment '해결 여부(문의 게시판에 사용)', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자', - comment_count tinyint unsigned default 0 not null comment '전체 댓글 수', - meta text null comment '등록일자 / 공지사항 주소 등 정보를 String으로 저장', - is_notice tinyint(1) default 0 not null comment '공지사항인지 여부', - notice_article_id int unsigned null comment '공지사항 고유 id', - constraint notice_article_id_UNIQUE - unique (notice_article_id) -) - collate = utf8_unicode_ci; - -create table if not exists boards -( - id int unsigned auto_increment comment 'board 고유 id' - primary key, - tag varchar(10) not null comment '게시판 태그', - name varchar(50) not null comment '게시판 이름', - is_anonymous tinyint(1) default 0 not null comment '익명 닉네임을 사용하는지 여부', - article_count int unsigned default 0 not null comment '게시글 개수', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자', - is_notice tinyint(1) default 0 not null comment '공지사항인지 여부', - parent_id int unsigned null, - seq int unsigned default 0 not null, - constraint boards_tag_unique - unique (tag) -) - collate = utf8_unicode_ci; - -create table if not exists calendar_universities -( - id int unsigned auto_increment - primary key, - year varchar(10) not null, - start_month varchar(10) not null, - end_month varchar(10) not null, - start_day varchar(10) not null, - end_day varchar(10) not null, - schedule varchar(255) not null, - seq int unsigned not null, - is_continued tinyint(1) default 0 not null, - created_at timestamp default CURRENT_TIMESTAMP not null, - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP, - constraint ux_year_seq - unique (year, seq) -) - collate = utf8_unicode_ci; - -create table if not exists callvan_companies -( - id int unsigned auto_increment comment 'callvan companies 고유 id' - primary key, - name varchar(100) not null comment '콜벤 회사 이름', - phone varchar(100) not null comment '콜벤 회사 전화번호', - pay_card tinyint(1) default 0 not null comment '카드 여부(0:미사용 / 1:사용)', - pay_bank tinyint(1) default 0 not null comment '계좌이체 여부(0: 미사용 / 1:사용)', - hit int unsigned default 0 not null comment '전화 횟수', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자', - constraint callvan_companies_name_unique - unique (name) -) - collate = utf8_unicode_ci; - -create table if not exists callvan_participants -( - id int unsigned auto_increment comment 'callvan participants 고유 id' - primary key, - room_id int unsigned not null comment 'room 고유 id', - user_id int unsigned not null comment 'user 고유 id', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자' -) - collate = utf8_unicode_ci; - -create table if not exists callvan_rooms -( - id int unsigned auto_increment comment 'callvan rooms 고유 id' - primary key, - user_id int unsigned not null comment '방장을 맡은 user 고유 id', - departure_place varchar(100) not null comment '출발 장소', - departure_datetime timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '출발 시간', - arrival_place varchar(100) not null comment '도착 장소', - maximum_people int unsigned default 2 not null comment '최대 인원', - current_people int unsigned default 1 not null comment '현재 인원', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자' -) - collate = utf8_unicode_ci; - -create table if not exists circles -( - id int unsigned auto_increment comment 'circles 고유 id' - primary key, - category varchar(10) not null comment '동아리 카테고리', - name varchar(50) not null comment '동아리 이름', - line_description varchar(255) null comment '한 줄 설명', - logo_url text null comment '로고 이미지 링크', - description text null comment '세부 사항', - link_urls text null comment '외부 링크', - background_img_url text null comment '배경 이미지 링크', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - professor varchar(255) null comment '담당 교수', - location varchar(255) null comment '동아리방 위치', - major_business varchar(255) null comment '주요 사업', - introduce_url varchar(255) null comment '동아리 소개 홈페이지 url', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자' -) - collate = utf8_unicode_ci; - -create table if not exists comments -( - id int unsigned auto_increment comment 'comment 고유 id' - primary key, - article_id int unsigned not null comment '게시글 고유 id', - content text not null comment '내용', - user_id int unsigned not null comment '답글 user 고유 id', - nickname varchar(50) not null comment '답글 user 닉네임', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자' -) - collate = utf8_unicode_ci; - -create table if not exists courses -( - id int unsigned auto_increment - primary key, - region varchar(10) not null, - bus_type varchar(15) not null, - is_deleted tinyint(1) default 0 not null -) - collate = utf8mb4_bin; - -create table if not exists dept_infos -( - name varchar(45) not null - primary key, - curriculum_link varchar(255) not null, - is_deleted tinyint(1) default 0 not null, - constraint dept_name_UNIQUE - unique (name) -) - collate = utf8mb4_bin; - -create table if not exists dept_nums -( - dept_name varchar(45) not null, - dept_num varchar(5) not null, - primary key (dept_name, dept_num), - constraint fk_dept_name - foreign key (dept_name) references dept_infos (name) - on update cascade -) - collate = utf8mb4_bin; - -create index idx_dept_num - on dept_nums (dept_num); - -create table if not exists dining_menus -( - id int unsigned auto_increment comment 'dining menus 고유 id' - primary key, - date date not null comment '일자', - type varchar(9) not null comment '식사 유형(아침 , 점심, 저녁)', - place varchar(9) not null comment '종류(양식, 한식..)', - price_card int unsigned null comment '카드 금액', - price_cash int unsigned null comment '현금 금액', - kcal int unsigned null comment '칼로리', - menu text not null comment '메뉴', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자', - constraint ux_date_type_place - unique (date, type, place) -) - collate = utf8_unicode_ci; - -create table if not exists event_articles -( - id int unsigned auto_increment comment 'event articles 고유 id' - primary key, - shop_id int unsigned not null comment 'Shop(가게) 고유 id', - title varchar(255) not null comment '제목', - event_title varchar(50) not null comment '홍보 문구', - content text not null comment '내용', - user_id int not null comment 'user(작성자) 고유 id', - nickname varchar(50) not null comment '작성자 user 닉네임', - thumbnail varchar(255) null comment '썸네일 이미지', - hit int default 0 not null comment '조회수', - ip varchar(45) not null comment 'IP 주소', - start_date date not null comment '행사 시작일', - end_date date not null comment '행사 마감일', - comment_count tinyint(1) default 0 not null comment '전체 댓글수', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자', - constraint pk - unique (id) -) - collate = utf8_bin; - -create index idx_is_deleted - on event_articles (is_deleted); - -create index idx_timestamp - on event_articles (created_at); - -create table if not exists event_articles_view_logs -( - id int unsigned auto_increment comment 'event articles view logs 고유 id' - primary key, - event_articles_id int unsigned not null comment 'event articles 고유 id', - user_id int unsigned null comment '게시물을 본 user 고유 id', - expired_at timestamp null comment '만료 일자', - ip varchar(45) not null comment 'IP 주소', - constraint idx_unique - unique (event_articles_id, user_id) -) - collate = utf8_bin; - -create table if not exists event_comments -( - id int unsigned auto_increment comment 'event comments 고유 id' - primary key, - article_id int unsigned not null comment 'article(게시글) 고유 id', - content text not null comment '내용', - user_id int unsigned not null comment '답글 user 고유 id', - nickname varchar(50) not null comment '답글 user 닉네임', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자' -) - collate = utf8_bin; - -create table if not exists failed_jobs -( - id bigint unsigned auto_increment - primary key, - connection text not null, - queue text not null, - payload longtext not null, - exception longtext not null, - failed_at timestamp default CURRENT_TIMESTAMP not null -) - collate = utf8_unicode_ci; - -create table if not exists faqs -( - id int unsigned auto_increment comment 'faqs 고유 id' - primary key, - question varchar(255) not null comment '질문', - answer text not null comment '답변', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자', - circle_id int unsigned default 0 not null comment '관련 circle(동아리) id' -) - collate = utf8_unicode_ci; - -create table if not exists holidays -( - id int unsigned auto_increment - primary key, - name varchar(45) not null, - date date not null -) - collate = utf8_bin; - -create table if not exists integrated_assessments -( - id int unsigned auto_increment - primary key, - service_type varchar(255) not null, - evaluated_id int unsigned not null, - score_one int unsigned default 0 not null, - score_two int unsigned default 0 not null, - score_three int unsigned default 0 not null, - score_four int unsigned default 0 not null, - score_five int unsigned default 0 not null, - score_six int unsigned default 0 not null, - score_seven int unsigned default 0 not null, - score_eight int unsigned default 0 not null, - score_nine int unsigned default 0 not null, - score_ten int unsigned default 0 not null, - is_deleted tinyint(1) default 0 not null, - created_at timestamp default CURRENT_TIMESTAMP not null, - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP -) - collate = utf8_unicode_ci; - -create table if not exists item_comments -( - id int unsigned auto_increment comment 'item comments 고유 id' - primary key, - item_id int unsigned not null comment 'item 고유 id', - content text not null comment '내용', - user_id int unsigned not null comment '답글 user 고유 id', - nickname varchar(50) not null comment '답글 user 닉네임', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자' -) - collate = utf8_unicode_ci; - -create table if not exists item_view_logs -( - id int unsigned auto_increment comment 'item view logs 고유 id' - primary key, - item_id int unsigned not null comment 'item 고유 id', - user_id int unsigned null comment 'user(본 사람) 고유 id', - expired_at timestamp null comment '만료 시간', - ip varchar(45) not null comment 'IP 주소', - constraint item_view_logs_item_id_user_id_unique - unique (item_id, user_id) -) - collate = utf8_unicode_ci; - -create table if not exists items -( - id int unsigned auto_increment comment 'items 고유 id' - primary key, - type int unsigned not null comment '서비스 타입(0:팝니다 / 1:삽니다)', - title varchar(255) not null comment '제목', - content text null comment '내용', - user_id int unsigned not null comment '작성자 user 고유 id', - nickname varchar(50) not null comment '작성자 user 닉네임', - state int unsigned default 0 not null comment '상태 정보(0:판매중 / 1:판매완료 / 2:판매중지)', - price int unsigned default 0 not null comment '가격', - phone varchar(255) null comment '전화번호', - is_phone_open tinyint(1) default 0 not null comment '전화번호 공개 여부(0:비공개 / 1:공개)', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자', - thumbnail varchar(510) null comment '썸네일 이미지 링크', - hit int unsigned default 0 not null comment '조회수', - ip varchar(45) not null comment 'IP 주소' -) - collate = utf8_unicode_ci; - -create table if not exists land_comments -( - id int unsigned auto_increment comment 'land comments 고유 id' - primary key, - user_id int unsigned not null comment 'user 고유 id', - land_id int unsigned not null comment 'land(원룸) 고유 id', - content text not null comment '내용', - score int unsigned not null comment '평점', - nickname varchar(50) not null comment '댓글 user의 닉네임', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자' -) - collate = utf8_unicode_ci; - -create table if not exists lands -( - id int unsigned auto_increment comment 'lands 고유 id' - primary key, - name varchar(255) not null comment '건물 이름', - internal_name varchar(50) not null comment '건물 이름 소문자 변환 및 띄어쓰기 제거', - size varchar(255) null comment '방 크기', - room_type varchar(255) null comment '원룸 종류', - latitude varchar(255) null comment '위도', - longitude varchar(255) null comment '경도', - phone varchar(255) null comment '전화번호', - image_urls text null comment '이미지 링크', - address text null comment '주소', - description text null comment '세부 사항', - floor int unsigned null comment '층 수', - deposit varchar(255) null comment '보증금', - monthly_fee varchar(255) null comment '월세', - charter_fee varchar(255) null comment '전세', - management_fee varchar(255) null comment '관리비', - opt_refrigerator tinyint(1) default 0 not null comment '냉장고 보유 여부', - opt_closet tinyint(1) default 0 not null comment '옷장 보유 여부', - opt_tv tinyint(1) default 0 not null comment 'tv 보유 여부', - opt_microwave tinyint(1) default 0 not null comment '전자레인지 보유 여부', - opt_gas_range tinyint(1) default 0 not null comment '가스레인지 보유 여부', - opt_induction tinyint(1) default 0 not null comment '인덕션 보유 여부', - opt_water_purifier tinyint(1) default 0 not null comment '정수기 보유 여부', - opt_air_conditioner tinyint(1) default 0 not null comment '에어컨 보유 여부', - opt_washer tinyint(1) default 0 not null comment '샤워기 보유 여부', - opt_bed tinyint(1) default 0 not null comment '침대 보유 여부', - opt_desk tinyint(1) default 0 not null comment '책상 보유 여부', - opt_shoe_closet tinyint(1) default 0 not null comment '신발장 보유 여부', - opt_electronic_door_locks tinyint(1) default 0 not null comment '전자 도어락 보유 여부', - opt_bidet tinyint(1) default 0 not null comment '비데 보유 여부', - opt_veranda tinyint(1) default 0 not null comment '베란다 보유 여부', - opt_elevator tinyint(1) default 0 not null comment '엘레베이터 보유 여부', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자', - constraint ux_name - unique (name) -) - collate = utf8_unicode_ci; - -create index ix_internalname - on lands (internal_name); - -create table if not exists lectures -( - id int unsigned auto_increment comment 'lectures 고유 id' - primary key, - semester_date varchar(6) not null comment '학기', - code varchar(10) not null comment '강의 코드', - name varchar(50) not null comment '강의 이름', - grades varchar(2) not null comment '대상 학년', - class varchar(3) not null comment '강의 분반', - regular_number varchar(4) not null comment '수강 인원', - department varchar(30) not null comment '강의 학과', - target varchar(200) not null comment '강의 대상', - professor varchar(30) null comment '강의 교수', - is_english varchar(2) not null comment '영어강의 여부', - design_score varchar(2) not null comment '설계 학점', - is_elearning varchar(2) not null comment '이러닝 여부', - class_time varchar(100) not null comment '강의 시간', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자' -) - charset = utf8; - -create table if not exists lost_item_comments -( - id int unsigned auto_increment comment 'lost item comments 고유 id' - primary key, - lost_item_id int unsigned not null comment 'lost item (분실물) 고유 id', - content text not null comment '내용', - user_id int unsigned not null comment '답글 user 고유 id', - nickname varchar(50) not null comment '답글 user의 닉네임', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자' -) - collate = utf8_unicode_ci; - -create table if not exists lost_item_view_logs -( - id int unsigned auto_increment comment 'lost item view logs 고유 id' - primary key, - lost_item_id int unsigned not null comment 'lost_item(분실물) 고유 id', - user_id int unsigned null comment 'user 고유 id', - expired_at timestamp null comment '만료 시간', - ip varchar(45) not null comment 'IP 주소', - constraint lost_item_view_logs_lost_item_id_user_id_unique - unique (lost_item_id, user_id) -) - collate = utf8_unicode_ci; - -create table if not exists lost_items -( - id int unsigned auto_increment comment 'lost items 고유 id' - primary key, - type int unsigned not null comment '서비스 타입(0:습득 서비스 / 1:분실 서비스)', - title varchar(255) not null comment '제목', - location varchar(255) null comment '분실물 위치', - content text null comment '내용', - user_id int unsigned not null comment '작성자 user 고유 id', - nickname varchar(50) not null comment '작성자 user 닉네임', - state int unsigned default 0 not null comment '상태정보(0: 찾는중 / 1:돌려받음)', - phone varchar(255) null comment '전화 번호', - is_phone_open tinyint(1) default 0 not null comment '전화번호 공개 여부(0:비공개 / 1:공개)', - image_urls text null comment '이미지 링크', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자', - thumbnail varchar(510) null comment '썸네일 이미지', - hit int unsigned default 0 not null comment '조회수', - ip varchar(45) not null comment 'IP 주소', - comment_count tinyint unsigned default 0 not null comment '전체 댓글 수', - date date null comment '분실 물품 날짜' -) - collate = utf8_unicode_ci; - -create table if not exists members -( - id int auto_increment comment 'members 고유 id' - primary key, - name varchar(50) not null comment '이름', - student_number varchar(255) null comment '학번', - track_id int unsigned not null comment '소속 트랙 고유 id', - position varchar(255) not null comment '직급', - email varchar(100) null comment '이메일', - image_url text null comment '이미지 링크', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자' -) - collate = utf8_bin; - -create table if not exists migrations -( - id int unsigned auto_increment - primary key, - migration varchar(255) not null, - batch int not null -) - collate = utf8_unicode_ci; - -create table if not exists notice_articles -( - id int unsigned auto_increment comment 'notice articles 고유 id' - primary key, - board_id int unsigned not null comment '게시판 고유 id', - title varchar(255) not null comment '제목', - content mediumtext null comment '내용', - author varchar(50) not null comment '작성자', - hit int unsigned default 0 not null comment '조회수', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - article_num int unsigned not null comment '게시물 번호', - permalink varchar(100) not null comment '기존 게시글 url', - has_notice tinyint(1) default 0 not null comment '기존에 올라왔는지 여부', - registered_at varchar(255) null comment '등록 일자', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자', - constraint ux_notice_article - unique (board_id, article_num) -) - collate = utf8_unicode_ci; - -create table if not exists owners -( - user_id int not null comment 'user 고유 id' - primary key, - company_registration_number varchar(12) charset utf8 null comment '사업자등록번호', - company_registration_certificate_image_url varchar(255) null, - grant_shop tinyint default 0 null comment '상점 수정 권한', - grant_event tinyint default 0 null comment '이벤트 수정 권한', - constraint company_registration_number_UNIQUE - unique (company_registration_number) -) - collate = utf8_bin; - -create table if not exists password_resets -( - email varchar(255) not null, - token varchar(255) not null, - created_at timestamp null -) - collate = utf8_unicode_ci; - -create index password_resets_email_index - on password_resets (email); - -create table if not exists search_articles -( - id int unsigned auto_increment comment 'search articles 고유 id' - primary key, - table_id int unsigned not null comment '게시판(table) 고유 id', - article_id int unsigned not null comment 'article(게시글) 고유 id', - title varchar(255) not null comment '게시글 제목', - content text null comment '게시글 내용', - user_id int unsigned null comment 'user 고유 id', - nickname varchar(50) not null comment '닉네임', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자', - constraint idx_unique - unique (table_id, article_id), - constraint pk - unique (id) -) - collate = utf8_bin; - -create index idx_is_deleted - on search_articles (is_deleted); - -create index idx_nickname - on search_articles (nickname, is_deleted, created_at); - -create index idx_timestamp - on search_articles (created_at); - -create table if not exists semester -( - id int unsigned auto_increment - primary key, - semester varchar(10) not null comment '학기', - constraint semester_UNIQUE - unique (semester) -) - collate = utf8_bin; - -create table if not exists shop_categories -( - id int unsigned auto_increment comment 'shop_categories 고유 id' - primary key, - name varchar(255) not null comment '카테고리 이름', - image_url varchar(255) null comment '이미지 URL', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자' -) - collate = utf8_bin; - -create table if not exists shop_category_map -( - id int unsigned auto_increment comment 'shop_category_map 고유 id' - primary key, - shop_id int unsigned not null comment 'shops 고유 id', - shop_category_id int unsigned not null comment 'shop_categories 고유 id', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자', - constraint SHOP_ID_AND_SHOP_CATEGORY_ID - unique (shop_id, shop_category_id) -) - collate = utf8_bin; - -create table if not exists shop_images -( - id int unsigned auto_increment comment 'shop_images 고유 id' - primary key, - shop_id int unsigned not null comment 'shops 고유 id', - image_url varchar(255) null comment '이미지 URL', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자', - constraint SHOP_ID_AND_IMAGE_URL - unique (shop_id, image_url) -) - collate = utf8_bin; - -create table if not exists shop_menu_categories -( - id int unsigned auto_increment comment 'shop_menu_categories 고유 id' - primary key, - shop_id int unsigned not null comment 'shops 고유 id', - name varchar(255) not null comment '카테고리 이름', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자' -) - collate = utf8_bin; - -create table if not exists shop_menu_category_map -( - id int unsigned auto_increment comment 'shop_menu_category_map 고유 id' - primary key, - shop_menu_id int unsigned not null comment 'shop_menus 고유 id', - shop_menu_category_id int unsigned not null comment 'shop_menu_categories 고유 id', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자', - constraint SHOP_MENU_ID_AND_SHOP_MENU_CATEGORY_ID - unique (shop_menu_id, shop_menu_category_id) -) - collate = utf8_bin; - -create table if not exists shop_menu_details -( - id int unsigned auto_increment comment 'shop_menu_details 고유 id' - primary key, - shop_menu_id int unsigned not null comment 'shop_menus 고유 id', - `option` varchar(255) null comment '옵션 이름', - price int unsigned not null comment '가격', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자', - constraint SHOP_MENU_ID_AND_OPTION_AND_PRICE - unique (shop_menu_id, `option`, price) -) - collate = utf8_bin; - -create table if not exists shop_menu_images -( - id int unsigned auto_increment comment 'shop_menu_images 고유 id' - primary key, - shop_menu_id int unsigned not null comment 'shop_menus 고유 id', - image_url varchar(255) not null comment '이미지 URL', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자', - constraint SHOP_MENU_ID_AND_IMAGE_URL - unique (shop_menu_id, image_url) -) - collate = utf8_bin; - -create table if not exists shop_menus -( - id int unsigned auto_increment comment 'shop_menus 고유 id' - primary key, - shop_id int unsigned not null comment 'shop 고유 id', - name varchar(255) not null comment '메뉴 이름', - description varchar(255) null comment '메뉴 구성', - is_hidden tinyint(1) default 0 not null comment '숨김 여부', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자' -) - collate = utf8_unicode_ci; - -create table if not exists shop_opens -( - id int unsigned auto_increment comment 'shop_open 고유 id' - primary key, - shop_id int unsigned not null comment 'shops 고유 id', - day_of_week varchar(10) not null comment '요일', - closed tinyint(1) not null comment '휴무 여부', - open_time varchar(10) null comment '오픈 시간', - close_time varchar(10) null comment '마감 시간', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자' -) - collate = utf8_bin; - -create table if not exists shop_view_logs -( - id int unsigned auto_increment comment 'shop_view_logs 고유 id' - primary key, - shop_id int unsigned not null comment '가게 고유 id', - user_id int unsigned null comment 'user 고유 id', - expired_at timestamp null comment '만료 시간', - ip varchar(45) not null comment '조회한 IP 주소' -) - collate = utf8_bin; - -create table if not exists shops -( - id int unsigned auto_increment comment 'shops 고유 id' - primary key, - owner_id int null comment 'owner 고유 id', - name varchar(50) not null comment '가게 이름', - internal_name varchar(50) not null comment '가게 이름을 소문자로 변경하고 띄어쓰기 제거', - chosung varchar(3) null comment '가게 이름 앞자리 1글자의 초성', - phone varchar(50) null comment '전화 번호', - address text null comment '주소', - description text null comment '세부 사항', - delivery tinyint(1) default 0 not null comment '배달 가능 여부', - delivery_price int unsigned default 0 not null comment '배달 금액', - pay_card tinyint(1) default 0 not null comment '카드 가능 여부', - pay_bank tinyint(1) default 0 not null comment '계좌이체 가능 여부', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자', - is_event tinyint(1) default 0 not null comment '이벤트 진행 여부', - remarks text null comment '이벤트 상세내용 등 부가내용', - hit int unsigned default 0 not null comment '조회수' -) - charset = utf8mb4; - -create index ix_internalname - on shops (internal_name); - -create table if not exists students -( - user_id int not null comment 'user 고유 id' - primary key, - anonymous_nickname varchar(255) null comment '익명 닉네임', - student_number varchar(255) null comment '학번', - major varchar(50) null comment '전공', - identity smallint null comment '신원(0: 학생, 1: 대학원생)', - is_graduated tinyint(1) null comment '졸업 여부', - constraint anonymous_nickname_UNIQUE - unique (anonymous_nickname) -) - collate = utf8_bin; - -create table if not exists survey_answers -( - id int unsigned auto_increment - primary key, - survey_id int unsigned not null, - question_id int unsigned not null, - content text not null, - is_deleted tinyint(1) default 0 not null, - created_at timestamp default CURRENT_TIMESTAMP not null, - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP -) - collate = utf8_unicode_ci; - -create table if not exists survey_questions -( - id int unsigned auto_increment - primary key, - survey_id int unsigned not null, - `order` int unsigned not null, - order_sub int unsigned default 0 not null, - type varchar(255) not null, - title varchar(255) not null, - choices text not null, - is_deleted tinyint(1) default 0 not null, - is_required tinyint(1) default 0 not null, - created_at timestamp default CURRENT_TIMESTAMP not null, - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP -) - collate = utf8_unicode_ci; - -create table if not exists survey_view_logs -( - id int unsigned auto_increment - primary key, - survey_id int unsigned not null, - expired_at timestamp null, - ip varchar(45) not null, - constraint survey_view_logs_survey_id_ip_unique - unique (survey_id, ip) -) - collate = utf8_unicode_ci; - -create table if not exists surveys -( - id int unsigned auto_increment - primary key, - user_id int unsigned not null, - title varchar(255) not null, - description varchar(255) null, - conclusion varchar(255) null, - is_answer_open tinyint(1) default 0 not null, - started_at timestamp null, - finished_at timestamp null, - state tinyint default 0 not null, - is_deleted tinyint(1) default 0 not null, - created_at timestamp default CURRENT_TIMESTAMP not null, - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP, - hit int unsigned default 0 not null, - tag varchar(255) null, - is_recruit tinyint(1) default 0 not null -) - collate = utf8_unicode_ci; - -create table if not exists tech_stacks -( - id int unsigned auto_increment comment 'tech_stacks 고유 id' - primary key, - image_url text null comment '이미지 링크', - name varchar(50) not null comment '기술 스택 명', - description varchar(100) null comment '기술 스택 설명', - track_id int unsigned not null comment 'track 고유 id', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자' -) - collate = utf8_bin; - -create table if not exists temp_articles -( - id int unsigned auto_increment comment 'temp_articles 고유 id' - primary key, - title varchar(255) not null comment '제목', - content text null comment '내용', - nickname varchar(50) not null comment '작성자 닉네임', - password text not null comment '익명게시글 비밀번호', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '작성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자', - hit int unsigned default 0 not null comment '조회수', - comment_count tinyint unsigned default 0 not null comment '전체 댓글 수' -) - collate = utf8_unicode_ci; - -create table if not exists temp_comments -( - id int unsigned auto_increment comment 'temp_comments 고유 id' - primary key, - article_id int unsigned not null comment 'article(게시글) 고유 id', - content text not null comment '내용', - nickname varchar(50) not null comment '작성자 닉네임', - password text not null comment '익명댓글 비밀번호', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자' -) - collate = utf8_unicode_ci; - -create table if not exists test -( - id int unsigned auto_increment - primary key, - portal_account varchar(50) not null, - constraint users_portal_account_unique - unique (portal_account) -) - collate = utf8_unicode_ci; - -create table if not exists timetables -( - id int unsigned auto_increment comment 'timetables 고유 id' - primary key, - user_id int unsigned not null comment 'user 고유 id', - semester_id int unsigned not null comment '학기 고유 id', - code varchar(10) null comment '과목 코드', - class_title varchar(50) not null comment '과목 명', - class_time varchar(100) not null comment '과목 시간', - class_place varchar(30) null comment '수업 장소', - professor varchar(30) null comment '담당 교수', - grades varchar(2) not null comment '학점', - lecture_class varchar(3) null comment '분반', - target varchar(200) null comment '학년 대상', - regular_number varchar(4) null comment '수강 정원', - design_score varchar(4) null comment '설계', - department varchar(30) null comment '학부', - memo varchar(200) null comment '사용자용 메모', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자' -) - collate = utf8_bin; - -create table if not exists tracks -( - id int unsigned auto_increment comment 'tracks 테이블 고유 id' - primary key, - name varchar(50) not null comment '트랙명', - headcount int unsigned default 0 not null comment '인원수', - is_deleted tinyint(1) default 0 not null comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자' -) - collate = utf8_bin; - -create table if not exists users -( - id int unsigned auto_increment comment 'users 테이블 고유 id' - primary key, - password text not null comment '비밀번호', - nickname varchar(50) null comment '닉네임', - name varchar(50) null comment '이름', - phone_number varchar(255) null comment '휴대 전화 번호', - user_type varchar(255) not null comment '유저 타입(Students or Owners)', - email varchar(100) not null comment '학교 email', - gender int unsigned null comment '성별', - is_authed tinyint(1) default 0 not null comment '인증 여부', - last_logged_at timestamp null comment '최근 로그인 일자', - profile_image_url varchar(255) null comment '프로필 이미지 s3 url', - is_deleted tinyint(1) default 0 not null comment '탈퇴 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '회원가입 일자(생성 일자)', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자', - auth_token varchar(255) null comment '이메일 인증 토큰', - auth_expired_at varchar(255) null comment '이메일 인증 토큰 만료 시간', - reset_token varchar(255) null comment '비밀번호 초기화 토큰', - reset_expired_at varchar(255) null comment '비밀번호 초기화 토큰 만료 시간', - constraint email_UNIQUE - unique (email), - constraint nickname_UNIQUE - unique (nickname) -) - collate = utf8_unicode_ci; - -create table if not exists owner_attachments -( - id int unsigned auto_increment - primary key, - owner_id int unsigned not null, - url text not null, - is_deleted tinyint(1) default 0 not null, - created_at timestamp default CURRENT_TIMESTAMP not null, - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP, - constraint owner_shop_attachment_fk_owner_id - foreign key (owner_id) references users (id) -) - collate = utf8_bin; - -create table if not exists users_owners -( - id int unsigned auto_increment comment 'users_owners 고유 id' - primary key, - user_id int unsigned not null comment 'users 중에 owners에 해당하는 user_id', - email varchar(125) null comment '연락 가능한 이메일', - constraint email_UNIQUE - unique (email), - constraint user_id_UNIQUE - unique (user_id), - constraint users_owners_fk_user_id - foreign key (user_id) references users (id) - on delete cascade -) - collate = utf8_bin; - -create table if not exists versions -( - id int unsigned auto_increment comment 'versions 테이블 고유 id' - primary key, - version varchar(255) not null comment '버전 명 (예시 : 1.1.0)', - type varchar(255) null, - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자', - constraint versions_type_unique - unique (type) -) - collate = utf8_unicode_ci; diff --git a/src/main/resources/db/migration/V200__add_campus_delivery_address_x_y_position.sql b/src/main/resources/db/migration/V200__add_campus_delivery_address_x_y_position.sql deleted file mode 100644 index 33b9971752..0000000000 --- a/src/main/resources/db/migration/V200__add_campus_delivery_address_x_y_position.sql +++ /dev/null @@ -1,91 +0,0 @@ -ALTER TABLE `koin`.`campus_delivery_address` - ADD COLUMN `latitude` DECIMAL(10, 8) NULL COMMENT '위도' AFTER `short_address`, - ADD COLUMN `longitude` DECIMAL(11, 8) NULL COMMENT '경도' AFTER `latitude`; - -UPDATE `koin`.`campus_delivery_address` -SET `latitude` = 36.76125794, `longitude` = 127.28372942 -WHERE `short_address` = '101동(해울)'; - -UPDATE `koin`.`campus_delivery_address` -SET `latitude` = 36.76156794, `longitude` = 127.28315659 -WHERE `short_address` = '102동(예지)'; - -UPDATE `koin`.`campus_delivery_address` -SET `latitude` = 36.76186385, `longitude` = 127.28376805 -WHERE `short_address` = '103동(예솔)'; - -UPDATE `koin`.`campus_delivery_address` -SET `latitude` = 36.76242319, `longitude` = 127.28349572 -WHERE `short_address` = '104동(다솔)'; - -UPDATE `koin`.`campus_delivery_address` -SET `latitude` = 36.76202833, `longitude` = 127.28281109 -WHERE `short_address` = '105동(함지)'; - -UPDATE `koin`.`campus_delivery_address` -SET `latitude` = 36.76163337, `longitude` = 127.28216566 -WHERE `short_address` = '106동(한울)'; - -UPDATE `koin`.`campus_delivery_address` -SET `latitude` = 36.76130110, `longitude` = 127.28168287 -WHERE `short_address` = '201동(솔빛)'; - -UPDATE `koin`.`campus_delivery_address` -SET `latitude` = 36.76084201, `longitude` = 127.28147960 -WHERE `short_address` = '202동(청솔)'; - -UPDATE `koin`.`campus_delivery_address` -SET `latitude` = 36.76049078, `longitude` = 127.28139432 -WHERE `short_address` = '203동(IH)'; - -UPDATE `koin`.`campus_delivery_address` -SET `latitude` = 36.76015392, `longitude` = 127.28094511 -WHERE `short_address` = '204동(은솔)'; - -UPDATE `koin`.`campus_delivery_address` -SET `latitude` = 36.76083418, `longitude` = 127.28098119 -WHERE `short_address` = '205동(참빛)'; - -UPDATE `koin`.`campus_delivery_address` -SET `latitude` = 36.76548530, `longitude` = 127.28040455 -WHERE `short_address` = '공학 1관'; - -UPDATE `koin`.`campus_delivery_address` -SET `latitude` = 36.76674321, `longitude` = 127.28194918 -WHERE `short_address` = '공학 2관'; - -UPDATE `koin`.`campus_delivery_address` -SET `latitude` = 36.76483840, `longitude` = 127.27959579 -WHERE `short_address` = '공학 3관'; - -UPDATE `koin`.`campus_delivery_address` -SET `latitude` = 36.76146765, `longitude` = 127.27984115 -WHERE `short_address` = '공학4관 A동'; - -UPDATE `koin`.`campus_delivery_address` -SET `latitude` = 36.76174156, `longitude` = 127.28023413 -WHERE `short_address` = '공학4관 B동'; - -UPDATE `koin`.`campus_delivery_address` -SET `latitude` = 36.76590843, `longitude` = 127.28247253 -WHERE `short_address` = '담헌실학관'; - -UPDATE `koin`.`campus_delivery_address` -SET `latitude` = 36.76498642, `longitude` = 127.28178594 -WHERE `short_address` = '인문경영관'; - -UPDATE `koin`.`campus_delivery_address` -SET `latitude` = 36.76282473, `longitude` = 127.28326760 -WHERE `short_address` = '테니스장'; - -UPDATE `koin`.`campus_delivery_address` -SET `latitude` = 36.76302056, `longitude` = 127.28238914 -WHERE `short_address` = '학생회관'; - -UPDATE `koin`.`campus_delivery_address` -SET `latitude` = 36.76362895, `longitude` = 127.28042579 -WHERE `short_address` = '다산정보관'; - -UPDATE `koin`.`campus_delivery_address` -SET `latitude` = 36.76303229, `longitude` = 127.28124121 -WHERE `short_address` = '복지관'; diff --git a/src/main/resources/db/migration/V201__alter_versions_bus_shuttle.sql b/src/main/resources/db/migration/V201__alter_versions_bus_shuttle.sql deleted file mode 100644 index 15b1be11bc..0000000000 --- a/src/main/resources/db/migration/V201__alter_versions_bus_shuttle.sql +++ /dev/null @@ -1,4 +0,0 @@ -UPDATE versions -SET title = '방학기간', - content = '2025-07-16~2025-08-31' -WHERE type = 'shuttle_bus_timetable'; diff --git a/src/main/resources/db/migration/V202__add_coop_semester_timetable.sql b/src/main/resources/db/migration/V202__add_coop_semester_timetable.sql deleted file mode 100644 index 28ee66639b..0000000000 --- a/src/main/resources/db/migration/V202__add_coop_semester_timetable.sql +++ /dev/null @@ -1,52 +0,0 @@ -INSERT INTO `koin`.`coop_semester` (`semester`, `from_date`, `to_date`, `is_applied`) -VALUES ('25-하계방학-비계절', '2025-07-12', '2025-08-31', 1); - -SET @SEMESTER_ID = LAST_INSERT_ID(); - -INSERT INTO `koin`.`coop_shop` (`coop_name_id`, `phone`, `location`, `remarks`, `semester_id`) -VALUES (1, '041-560-1278', '학생회관 2층', '비계절학기 토/일 미운영', @SEMESTER_ID), - (2, '041-560-1778', '복지관 2층', '능수관, 계절학기까지 운영', @SEMESTER_ID), - (3, '041-560-1779', '복지관 1층', NULL, @SEMESTER_ID), - (4, '041-560-1756', '복지관 1층', NULL, @SEMESTER_ID), - (5, '041-552-1763', '학생회관 2층', '점심시간 12:00 - 13:00', @SEMESTER_ID), - (6, '041-560-1093', '학생회관 2층', '점심시간 11:30 - 12:30', @SEMESTER_ID), - (7, '041-560-1279', '복지관 1층, 참빛관 1층', NULL, @SEMESTER_ID), - (8, '041-560-1372', '학생회관 1층', NULL, @SEMESTER_ID), - (9, '041-560-1472', '학생회관 1층', NULL, @SEMESTER_ID), - (10, '041-560-1758', '학생회관 1층', '점심시간 12:00 - 13:00', @SEMESTER_ID), - (11, '041-560-1760', '학생회관 1층', '점심시간 13:00 - 14:00', @SEMESTER_ID); - -SET @COOP_SHOP_ID = LAST_INSERT_ID(); - -INSERT INTO `koin`.`coop_opens` (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) -VALUES (@COOP_SHOP_ID, '아침', 'WEEKDAYS', '08:00', '09:00'), - (@COOP_SHOP_ID, '점심', 'WEEKDAYS', '11:30', '13:30'), - (@COOP_SHOP_ID, '저녁', 'WEEKDAYS', '17:30', '18:30'), - (@COOP_SHOP_ID, '아침', 'WEEKEND', '미운영', '미운영'), - (@COOP_SHOP_ID, '점심', 'WEEKEND', '미운영', '미운영'), - (@COOP_SHOP_ID, '저녁', 'WEEKEND', '미운영', '미운영'), - (@COOP_SHOP_ID + 1, '점심', 'WEEKDAYS', '미운영', '미운영'), - (@COOP_SHOP_ID + 1, '점심', 'WEEKEND', '미운영', '미운영'), - (@COOP_SHOP_ID + 2, NULL, 'WEEKDAYS', '08:30', '20:00'), - (@COOP_SHOP_ID + 2, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 3, NULL, 'WEEKDAYS', '09:00', '18:00'), - (@COOP_SHOP_ID + 3, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 4, NULL, 'WEEKDAYS', '10:30', '16:00'), - (@COOP_SHOP_ID + 4, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 5, NULL, 'WEEKDAYS', '10:00', '16:00'), - (@COOP_SHOP_ID + 5, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 6, NULL, 'WEEKDAYS', '24시간', '24시간'), - (@COOP_SHOP_ID + 6, NULL, 'WEEKEND', '24시간', '24시간'), - (@COOP_SHOP_ID + 7, NULL, 'WEEKDAYS', '10:00', '16:00'), - (@COOP_SHOP_ID + 7, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 8, NULL, 'WEEKDAYS', '24시간', '24시간'), - (@COOP_SHOP_ID + 8, NULL, 'WEEKEND', '24시간', '24시간'), - (@COOP_SHOP_ID + 9, NULL, 'WEEKDAYS', '09:00', '18:00'), - (@COOP_SHOP_ID + 9, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 10, NULL, 'WEEKDAYS', '11:00', '17:00'), - (@COOP_SHOP_ID + 10, NULL, 'FRIDAY', '휴점', '휴점'), - (@COOP_SHOP_ID + 10, NULL, 'WEEKEND', '휴점', '휴점'); - -UPDATE `koin`.`coop_semester` -SET `is_applied` = 0 -WHERE `semester` = '25-하계방학'; diff --git a/src/main/resources/db/migration/V203__seperate_user_table.sql b/src/main/resources/db/migration/V203__seperate_user_table.sql deleted file mode 100644 index 8311e5539d..0000000000 --- a/src/main/resources/db/migration/V203__seperate_user_table.sql +++ /dev/null @@ -1,59 +0,0 @@ --- 영양사 -ALTER TABLE coop - MODIFY COLUMN coop_id VARCHAR(255) NOT NULL; - --- 사장님 -ALTER TABLE owners - MODIFY COLUMN account VARCHAR (11) NOT NULL, - MODIFY COLUMN company_registration_number VARCHAR (12) CHARACTER SET utf8mb3 NOT NULL; - - --- 어드민 -ALTER TABLE admins - ADD COLUMN login_id VARCHAR(255), - ADD COLUMN email VARCHAR(255); - -UPDATE admins a - JOIN users u -ON a.user_id = u.id - SET a.login_id = u.user_id, a.email = u.email; - -ALTER TABLE admins - MODIFY COLUMN login_id VARCHAR (255) NOT NULL, - MODIFY COLUMN email VARCHAR (255) NOT NULL, - ADD CONSTRAINT uq_admin_login_id UNIQUE (login_id), - ADD CONSTRAINT uq_admin_email UNIQUE (email); - --- 유저 -ALTER TABLE users - MODIFY COLUMN user_id VARCHAR (255), - ADD CONSTRAINT uq_users_login_id UNIQUE (user_id), - ADD CONSTRAINT uq_users_nickname UNIQUE (nickname), - ADD CONSTRAINT uq_users_phone_number UNIQUE (phone_number), - ADD CONSTRAINT uq_users_email UNIQUE (email); - - -ALTER TABLE `users` - ADD COLUMN `anonymous_nickname` VARCHAR(255) NULL UNIQUE AFTER `is_deleted`; - -UPDATE `users` u - JOIN `students` s -ON u.id = s.user_id - SET u.anonymous_nickname = s.anonymous_nickname; - -UPDATE `users` -SET `anonymous_nickname` = CONCAT('익명_', SUBSTRING(CONCAT(MD5(RAND()), MD5(RAND())), 1, 13)) -WHERE `anonymous_nickname` IS NULL; - -ALTER TABLE `users` - MODIFY COLUMN `anonymous_nickname` VARCHAR (255) NOT NULL UNIQUE; - - -UPDATE users -SET - user_id = NULL, - nickname = NULL, - phone_number = NULL, - email = NULL -WHERE user_type NOT IN ('GENERAL', 'STUDENT', 'COUNCIL', 'COOP'); - diff --git a/src/main/resources/db/migration/V204__add_payment_idempotency_key.sql b/src/main/resources/db/migration/V204__add_payment_idempotency_key.sql deleted file mode 100644 index d1344e1aed..0000000000 --- a/src/main/resources/db/migration/V204__add_payment_idempotency_key.sql +++ /dev/null @@ -1,11 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`payment_idempotency_key` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '결제 멱등키 ID', - `user_id` INT UNSIGNED NOT NULL COMMENT '유저 ID', - `idempotency_key` VARCHAR(300) NOT NULL COMMENT '결제 멱등키', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', - PRIMARY KEY (`id`), - UNIQUE KEY `uk_idempotency_key_user_id` (`user_id`), - CONSTRAINT `fk_user` FOREIGN KEY (`user_id`) REFERENCES `koin`.`users` (`id`) -); diff --git a/src/main/resources/db/migration/V205__alter_order_nullable.sql b/src/main/resources/db/migration/V205__alter_order_nullable.sql deleted file mode 100644 index 4946a37b62..0000000000 --- a/src/main/resources/db/migration/V205__alter_order_nullable.sql +++ /dev/null @@ -1,18 +0,0 @@ -ALTER TABLE `koin`.`order_delivery` - MODIFY COLUMN `to_owner` VARCHAR (50) NULL COMMENT '사장님 전달 메시지', - MODIFY COLUMN `to_rider` VARCHAR (50) NULL COMMENT '라이더 전달 메시지'; - -UPDATE `koin`.`order_delivery` -SET `to_owner` = NULL -WHERE TRIM(`to_owner`) = ''; - -UPDATE `koin`.`order_delivery` -SET `to_rider` = NULL -WHERE TRIM(`to_rider`) = ''; - -ALTER TABLE `koin`.`order_takeout` - MODIFY COLUMN `to_owner` VARCHAR (50) NULL COMMENT '사장님 전달 메시지'; - -UPDATE `koin`.`order_takeout` -SET `to_owner` = NULL -WHERE TRIM(`to_owner`) = ''; diff --git a/src/main/resources/db/migration/V206__add_option_group_name_column.sql b/src/main/resources/db/migration/V206__add_option_group_name_column.sql deleted file mode 100644 index 1cb5093205..0000000000 --- a/src/main/resources/db/migration/V206__add_option_group_name_column.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `koin`.`order_menu_option` - ADD COLUMN `option_group_name` VARCHAR(255) NOT NULL COMMENT '주문 메뉴 옵션 이름'; diff --git a/src/main/resources/db/migration/V207__alter_order_menu_table.sql b/src/main/resources/db/migration/V207__alter_order_menu_table.sql deleted file mode 100644 index 6a49181b05..0000000000 --- a/src/main/resources/db/migration/V207__alter_order_menu_table.sql +++ /dev/null @@ -1,8 +0,0 @@ -ALTER TABLE `koin`.`order_menu` - ADD COLUMN `menu_price_name` VARCHAR(255) NULL COMMENT '메뉴 가격 이름'; - -ALTER TABLE `koin`.`order_menu` - MODIFY COLUMN `menu_option_name` VARCHAR(255) NULL COMMENT '메뉴 옵션 이름'; - -UPDATE `koin`.`order_menu` SET - `menu_option_name` = NULL; diff --git a/src/main/resources/db/migration/V208__alter_club_table.sql b/src/main/resources/db/migration/V208__alter_club_table.sql deleted file mode 100644 index 84ee9d5f28..0000000000 --- a/src/main/resources/db/migration/V208__alter_club_table.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE club ADD COLUMN normalized_name VARCHAR(50) COMMENT '검색용 정규화 이름'; -UPDATE club SET normalized_name = LOWER(REPLACE(name, ' ', '')); -ALTER TABLE club MODIFY COLUMN normalized_name VARCHAR(50) NOT NULL COMMENT '검색용 정규화 이름'; -DROP INDEX idx_club_name ON club; -CREATE INDEX idx_club_normalized_name ON club(normalized_name); diff --git a/src/main/resources/db/migration/V209__alter_table_shop_operation_add_index.sql b/src/main/resources/db/migration/V209__alter_table_shop_operation_add_index.sql deleted file mode 100644 index 57b361f223..0000000000 --- a/src/main/resources/db/migration/V209__alter_table_shop_operation_add_index.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX idx_shop_operation_shop_id_open_deleted ON shop_operation(shop_id, is_open, is_deleted); diff --git a/src/main/resources/db/migration/V20__alter_coop_id_column_not_null.sql b/src/main/resources/db/migration/V20__alter_coop_id_column_not_null.sql deleted file mode 100644 index 5534b212f7..0000000000 --- a/src/main/resources/db/migration/V20__alter_coop_id_column_not_null.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `koin`.`coop` - CHANGE COLUMN `coop_id` `coop_id` VARCHAR(255) NOT NULL COMMENT '영양사 id, 일반 로그인 형식' ; diff --git a/src/main/resources/db/migration/V210__alter_table_shop_reviews_add_index.sql b/src/main/resources/db/migration/V210__alter_table_shop_reviews_add_index.sql deleted file mode 100644 index d356402cb7..0000000000 --- a/src/main/resources/db/migration/V210__alter_table_shop_reviews_add_index.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX idx_shop_reviews_covering ON shop_reviews(shop_id, is_deleted, rating); diff --git a/src/main/resources/db/migration/V211__add_provide_cutlery_column.sql b/src/main/resources/db/migration/V211__add_provide_cutlery_column.sql deleted file mode 100644 index 9201d2814b..0000000000 --- a/src/main/resources/db/migration/V211__add_provide_cutlery_column.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE `koin`.`order_takeout` - ADD COLUMN `provide_cutlery` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '수저, 포크 수령 여부'; - -ALTER TABLE `koin`.`order_delivery` - ADD COLUMN `provide_cutlery` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '수저, 포크 수령 여부'; diff --git a/src/main/resources/db/migration/V212__add_coop_semester_25-2nd_timetable.sql.sql b/src/main/resources/db/migration/V212__add_coop_semester_25-2nd_timetable.sql.sql deleted file mode 100644 index cc83a87d0e..0000000000 --- a/src/main/resources/db/migration/V212__add_coop_semester_25-2nd_timetable.sql.sql +++ /dev/null @@ -1,51 +0,0 @@ -INSERT INTO `koin`.`coop_semester` (`semester`, `from_date`, `to_date`, `is_applied`) -VALUES ('25-2학기', '2025-09-01', '2025-12-19', 1); - -SET @SEMESTER_ID = LAST_INSERT_ID(); - -INSERT INTO `koin`.`coop_shop` (`coop_name_id`, `phone`, `location`, `remarks`, `semester_id`) -VALUES (1, '041-560-1278', '학생회관 2층', '천원의 아침밥 평일 운영', @SEMESTER_ID), - (2, '041-560-1778', '복지관 2층', '복지관 리모델링 공사(2학기)', @SEMESTER_ID), - (3, '041-560-1779', '복지관 1층', '배달 서비스 실시, 공·일요일 미운영', @SEMESTER_ID), - (4, '041-560-1756', '복지관 1층', NULL, @SEMESTER_ID), - (5, '041-552-1489', '학생회관 2층', '점심시간 12:00 - 13:00', @SEMESTER_ID), - (6, '041-560-1093', '학생회관 2층', '점심시간 11:30 - 12:30', @SEMESTER_ID), - (7, '041-560-1279', '복지관 1층, 참빛관 1층', '복지관·생활관', @SEMESTER_ID), - (8, '041-560-1372', '학생회관 1층', '예약제운영', @SEMESTER_ID), - (9, '041-560-1472', '학생회관 1층', NULL, @SEMESTER_ID), - (10, '041-560-1758', '학생회관 1층', '점심시간 12:00 - 13:00', @SEMESTER_ID), - (11, '041-560-1760', '학생회관 1층', '점심시간 14:00 - 15:00', @SEMESTER_ID); - -SET @COOP_SHOP_ID = LAST_INSERT_ID(); - -INSERT INTO `koin`.`coop_opens` (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) -VALUES (@COOP_SHOP_ID, '아침', 'WEEKDAYS', '08:00', '09:30'), - (@COOP_SHOP_ID, '점심', 'WEEKDAYS', '11:30', '13:30'), - (@COOP_SHOP_ID, '저녁', 'WEEKDAYS', '17:30', '18:30'), - (@COOP_SHOP_ID, '아침', 'WEEKEND', '조식 미운영', '조식 미운영'), - (@COOP_SHOP_ID, '점심', 'WEEKEND', '11:30', '13:30'), - (@COOP_SHOP_ID, '저녁', 'WEEKEND', '17:30', '18:30'), - (@COOP_SHOP_ID + 1, '점심', 'WEEKDAYS', '미운영', '미운영'), - (@COOP_SHOP_ID + 1, '점심', 'WEEKEND', '미운영', '미운영'), - (@COOP_SHOP_ID + 2, NULL, 'WEEKDAYS', '08:30', '21:00'), - (@COOP_SHOP_ID + 2, NULL, 'SATURDAY', '11:00', '18:30'), - (@COOP_SHOP_ID + 3, NULL, 'WEEKDAYS', '09:00', '18:00'), - (@COOP_SHOP_ID + 3, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 4, NULL, 'WEEKDAYS', '11:30', '18:00'), - (@COOP_SHOP_ID + 4, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 5, NULL, 'WEEKDAYS', '08:30', '18:00'), - (@COOP_SHOP_ID + 5, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 6, NULL, 'WEEKDAYS', '24시간', '24시간'), - (@COOP_SHOP_ID + 6, NULL, 'WEEKEND', '24시간', '24시간'), - (@COOP_SHOP_ID + 7, NULL, 'WEEKDAYS', '09:30', '17:00'), - (@COOP_SHOP_ID + 7, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 8, NULL, 'WEEKDAYS', '24시간', '24시간'), - (@COOP_SHOP_ID + 8, NULL, 'WEEKEND', '24시간', '24시간'), - (@COOP_SHOP_ID + 9, NULL, 'WEEKDAYS', '09:00', '18:00'), - (@COOP_SHOP_ID + 9, NULL, 'WEEKEND', '휴점', '휴점'), - (@COOP_SHOP_ID + 10, NULL, 'WEEKDAYS', '10:00', '19:00'), - (@COOP_SHOP_ID + 10, NULL, 'WEEKEND', '휴점', '휴점'); - -UPDATE `koin`.`coop_semester` -SET `is_applied` = 0 -WHERE `semester` = '25-하계방학'; diff --git a/src/main/resources/db/migration/V213__add_25-2nd_shuttle_bus.sql b/src/main/resources/db/migration/V213__add_25-2nd_shuttle_bus.sql deleted file mode 100644 index 385e019d03..0000000000 --- a/src/main/resources/db/migration/V213__add_25-2nd_shuttle_bus.sql +++ /dev/null @@ -1,4 +0,0 @@ -UPDATE versions -SET title = '정규학기', - content = '2025-09-01~2025-12-19' -WHERE type = 'shuttle_bus_timetable'; diff --git a/src/main/resources/db/migration/V214__add_idx_lecture_semester_code.sql b/src/main/resources/db/migration/V214__add_idx_lecture_semester_code.sql deleted file mode 100644 index c9d5ea0ca3..0000000000 --- a/src/main/resources/db/migration/V214__add_idx_lecture_semester_code.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX idx_lecture_semester_code ON `koin`.`lectures` (semester_date, code); diff --git a/src/main/resources/db/migration/V215__alter_table_add_column_user_delivery_address.sql b/src/main/resources/db/migration/V215__alter_table_add_column_user_delivery_address.sql deleted file mode 100644 index 66f1295b5a..0000000000 --- a/src/main/resources/db/migration/V215__alter_table_add_column_user_delivery_address.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `koin`.`user_delivery_address` - ADD COLUMN `address` text NULL COMMENT '상세 정보를 제외한 기본 주소' AFTER `building`; diff --git a/src/main/resources/db/migration/V216__alter_table_shops_add_column_address_detail.sql b/src/main/resources/db/migration/V216__alter_table_shops_add_column_address_detail.sql deleted file mode 100644 index 3247d192fc..0000000000 --- a/src/main/resources/db/migration/V216__alter_table_shops_add_column_address_detail.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `koin`.`shops` - ADD COLUMN `address_detail` TEXT NULL COMMENT '상세 주소' AFTER `address`; diff --git a/src/main/resources/db/migration/V217__add_order_v2_table.sql b/src/main/resources/db/migration/V217__add_order_v2_table.sql deleted file mode 100644 index 38a40f162a..0000000000 --- a/src/main/resources/db/migration/V217__add_order_v2_table.sql +++ /dev/null @@ -1,25 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`order_v2` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '주문 고유 ID', - `pg_order_id` VARCHAR(64) NOT NULL COMMENT 'PG 주문 ID', - `user_id` INT UNSIGNED NOT NULL COMMENT '유저 고유 ID', - `phone_number` VARCHAR(20) NOT NULL COMMENT '전화번호', - `orderable_shop_id` INT UNSIGNED NOT NULL COMMENT '주문 가능 상점 ID', - `orderable_shop_name` VARCHAR(255) NOT NULL COMMENT '주문 가능 상점 이름', - `orderable_shop_address` TEXT NOT NULL COMMENT '주문 가능 상점 주소', - `orderable_shop_address_detail` TEXT NULL COMMENT '주문 가능 상점 상세 주소', - `total_product_price` INT UNSIGNED NOT NULL COMMENT '상품 총 금액', - `discount_amount` INT UNSIGNED DEFAULT 0 NOT NULL COMMENT '할인 금액', - `total_price` INT UNSIGNED NOT NULL COMMENT '주문 총 금액', - `order_type` VARCHAR(10) NOT NULL COMMENT '주문 타입', - `status` VARCHAR(10) NOT NULL COMMENT '주문 상태', - `canceled_at` TIMESTAMP NULL COMMENT '취소 일시', - `canceled_reason` VARCHAR(200) NULL COMMENT '취소 사유', - `is_deleted` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', - PRIMARY KEY (`id`) -); - -CREATE INDEX `idx_user_id` ON `koin`.`order` (`user_id`); -CREATE INDEX `idx_orderable_shop_id` ON `koin`.`order` (`orderable_shop_id`); diff --git a/src/main/resources/db/migration/V218__add_order_delivery_v2.sql b/src/main/resources/db/migration/V218__add_order_delivery_v2.sql deleted file mode 100644 index 2ffb0d91d7..0000000000 --- a/src/main/resources/db/migration/V218__add_order_delivery_v2.sql +++ /dev/null @@ -1,17 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`order_delivery_v2` -( - `order_id` INT UNSIGNED NOT NULL COMMENT '주문 ID', - `address` TEXT NOT NULL COMMENT '배달 주소', - `address_detail` TEXT NULL COMMENT '배달 상세 주소', - `to_owner` VARCHAR(50) NOT NULL COMMENT '사장님 전달 메시지', - `to_rider` VARCHAR(50) NOT NULL COMMENT '라이더 전달 메시지', - `delivery_tip` INT UNSIGNED NOT NULL COMMENT '배달비', - `provide_cutlery` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '수저, 포크 수령 여부', - `dispatched_at` TIMESTAMP NULL COMMENT '배달 출발 일시', - `completed_at` TIMESTAMP NULL COMMENT '배달 완료 일시', - `estimated_arrival_at` TIMESTAMP NULL COMMENT '배달 완료 예상 일시', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', - PRIMARY KEY (order_id), - CONSTRAINT `fk_order_delivery_order_v2` FOREIGN KEY (`order_id`) REFERENCES `koin`.`order_v2` (`id`) -); diff --git a/src/main/resources/db/migration/V219__add_order_takeout_v2.sql b/src/main/resources/db/migration/V219__add_order_takeout_v2.sql deleted file mode 100644 index 7b82b543b7..0000000000 --- a/src/main/resources/db/migration/V219__add_order_takeout_v2.sql +++ /dev/null @@ -1,12 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`order_takeout_v2` -( - `order_id` INT UNSIGNED NOT NULL COMMENT '주문 ID', - `to_owner` VARCHAR(50) NOT NULL COMMENT '사장님 전달 메시지', - `provide_cutlery` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '수저, 포크 수령 여부', - `packaged_at` TIMESTAMP NULL COMMENT '표장 완료 일시', - `estimated_packaged_at` TIMESTAMP NULL COMMENT '표장 완료 예상 일시', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', - PRIMARY KEY (order_id), - CONSTRAINT `fk_order_takeout_order_v2` FOREIGN KEY (`order_id`) REFERENCES `koin`.`order_v2` (`id`) -); diff --git a/src/main/resources/db/migration/V21__add_timetable_frame.sql b/src/main/resources/db/migration/V21__add_timetable_frame.sql deleted file mode 100644 index 7969945e56..0000000000 --- a/src/main/resources/db/migration/V21__add_timetable_frame.sql +++ /dev/null @@ -1,12 +0,0 @@ -CREATE TABLE timetable_frame ( - id INT UNSIGNED AUTO_INCREMENT NOT NULL comment '고유 id', - user_id INT UNSIGNED NOT NULL comment '유저 id', - semester_id INT UNSIGNED NOT NULL comment '학기 id', - name VARCHAR(255) NOT NULL comment '시간표 이름', - is_main TINYINT(1) NOT NULL DEFAULT 0 comment '메인 시간표 여부', - is_deleted TINYINT(1) NOT NULL DEFAULT 0 comment '시간표 삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '수정 일자', - PRIMARY KEY (`id`), - INDEX timetable_frame_INDEX (user_id, semester_id) USING BTREE -); diff --git a/src/main/resources/db/migration/V220__add_order_menu_v2.sql b/src/main/resources/db/migration/V220__add_order_menu_v2.sql deleted file mode 100644 index c2b0f31952..0000000000 --- a/src/main/resources/db/migration/V220__add_order_menu_v2.sql +++ /dev/null @@ -1,16 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`order_menu_v2` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '주문 메뉴 ID', - `order_id` INT UNSIGNED NOT NULL COMMENT '주문 ID', - `orderable_shop_menu_id` INT UNSIGNED NOT NULL COMMENT '주문 가능 상점 메뉴 ID', - `orderable_shop_menu_price_id` INT UNSIGNED NOT NULL COMMENT '주문 가능 상점 메뉴 가격 ID', - `name` VARCHAR(255) NOT NULL COMMENT '메뉴 이름', - `price_name` VARCHAR(255) NULL COMMENT '가격 이름', - `price` INT UNSIGNED NOT NULL COMMENT '가격', - `quantity` INT UNSIGNED NOT NULL COMMENT '수량', - `is_deleted` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', - PRIMARY KEY (`id`), - CONSTRAINT `fk_order_menu_order_v2` FOREIGN KEY (`order_id`) REFERENCES `koin`.`order_v2` (`id`) -); diff --git a/src/main/resources/db/migration/V221__add_order_menu_option_v2.sql b/src/main/resources/db/migration/V221__add_order_menu_option_v2.sql deleted file mode 100644 index 8259936044..0000000000 --- a/src/main/resources/db/migration/V221__add_order_menu_option_v2.sql +++ /dev/null @@ -1,16 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`order_menu_option_v2` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '메뉴 옵션 ID', - `order_menu_id` INT UNSIGNED NOT NULL COMMENT '주문 상점 메뉴 ID', - `orderable_shop_menu_option_group_id` INT UNSIGNED NOT NULL COMMENT '주문 가능 상점 메뉴 옵션 그룹 ID', - `orderable_shop_menu_option_id` INT UNSIGNED NOT NULL COMMENT '주문 가능 상점 메뉴 옵션 ID', - `group_name` VARCHAR(255) NOT NULL COMMENT '그룹 이름', - `name` VARCHAR(255) NOT NULL COMMENT '옵션 이름', - `price` INT UNSIGNED NOT NULL COMMENT '옵션 가격', - `quantity` INT UNSIGNED NOT NULL COMMENT '옵션 수량', - `is_deleted` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', - PRIMARY KEY (`id`), - CONSTRAINT `fk_order_menu_option_menu_v2` FOREIGN KEY (`order_menu_id`) REFERENCES `koin`.`order_menu_v2` (`id`) -); diff --git a/src/main/resources/db/migration/V222__add_payment_v2.sql b/src/main/resources/db/migration/V222__add_payment_v2.sql deleted file mode 100644 index 6e56cfa6ab..0000000000 --- a/src/main/resources/db/migration/V222__add_payment_v2.sql +++ /dev/null @@ -1,20 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`payment_v2` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `order_id` INT UNSIGNED NOT NULL COMMENT '주문 번호', - `payment_key` VARCHAR(200) NOT NULL COMMENT '결제 키', - `amount` INT UNSIGNED NOT NULL COMMENT '결제 금액', - `status` VARCHAR(30) NOT NULL COMMENT '결제 상태', - `method` VARCHAR(30) NOT NULL COMMENT '결제 수단', - `description` VARCHAR(255) NOT NULL COMMENT '결제 설명', - `easy_pay_company` VARCHAR(255) NULL COMMENT '간편 결제사', - `requested_at` TIMESTAMP NOT NULL COMMENT '결제 요청 일시', - `approved_at` TIMESTAMP NOT NULL COMMENT '결제 승인 일시', - `receipt` TEXT NOT NULL COMMENT '영수증', - `is_deleted` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', - PRIMARY KEY (`id`), - UNIQUE KEY uq_payment_key (`id`), - CONSTRAINT fk_payment_order_v2 FOREIGN KEY (`order_id`) REFERENCES `koin`.`order_v2` (`id`) -); diff --git a/src/main/resources/db/migration/V223__add_payment_cancel_v2.sql b/src/main/resources/db/migration/V223__add_payment_cancel_v2.sql deleted file mode 100644 index 52b209d1c2..0000000000 --- a/src/main/resources/db/migration/V223__add_payment_cancel_v2.sql +++ /dev/null @@ -1,14 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`payment_cancel_v2` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '결제 취소 ID', - `payment_id` INT UNSIGNED NOT NULL COMMENT '결제 ID', - `transaction_key` VARCHAR(64) NOT NULL COMMENT '취소 트랜잭션 키', - `reason` VARCHAR(200) NOT NULL COMMENT '취소 사유', - `amount` INT UNSIGNED NOT NULL COMMENT '취소 금액', - `canceled_at` TIMESTAMP NOT NULL COMMENT '취소 일시', - `is_deleted` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', - PRIMARY KEY (`id`), - CONSTRAINT `fk_payment_cancel_payment_v2` FOREIGN KEY (`payment_id`) REFERENCES `koin`.`payment_v2` (`id`) -); diff --git a/src/main/resources/db/migration/V224__alter_table_add_address_column.sql b/src/main/resources/db/migration/V224__alter_table_add_address_column.sql deleted file mode 100644 index 7d0a74fe3a..0000000000 --- a/src/main/resources/db/migration/V224__alter_table_add_address_column.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `koin`.`campus_delivery_address` - ADD COLUMN `address` TEXT NULL COMMENT '캠퍼스 배달 주소'; diff --git a/src/main/resources/db/migration/V225__alter_order_delivery_add_column.sql b/src/main/resources/db/migration/V225__alter_order_delivery_add_column.sql deleted file mode 100644 index d344115363..0000000000 --- a/src/main/resources/db/migration/V225__alter_order_delivery_add_column.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE `koin`.`order_delivery_v2` - ADD COLUMN `latitude` DECIMAL(10, 8) NULL COMMENT '위도' AFTER `address_detail`, - ADD COLUMN `longitude` DECIMAL(11, 8) NULL COMMENT '경도' AFTER `latitude`; diff --git a/src/main/resources/db/migration/V226__add_shop_order_service_requests.sql b/src/main/resources/db/migration/V226__add_shop_order_service_requests.sql deleted file mode 100644 index d4ec57fefc..0000000000 --- a/src/main/resources/db/migration/V226__add_shop_order_service_requests.sql +++ /dev/null @@ -1,21 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`shop_order_service_requests` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 ID', - `shop_id` INT UNSIGNED NOT NULL COMMENT '식당 ID', - `minimum_order_amount` INT UNSIGNED NOT NULL COMMENT '최소 주문 금액', - `is_takeout` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '포장 여부', - `delivery_option` VARCHAR(50) NOT NULL COMMENT '배달 옵션', - `campus_delivery_tip` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '캠퍼스 내 배달 팁', - `off_campus_delivery_tip` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '캠퍼스 외 배달 팁', - `business_license_url` VARCHAR(255) NOT NULL COMMENT '사업자 등록증 URL', - `business_certificate_url` VARCHAR(255) NOT NULL COMMENT '영업 신고증 URL', - `bank_copy_url` VARCHAR(255) NOT NULL COMMENT '통장 사본 URL', - `bank` VARCHAR(10) NOT NULL COMMENT '은행명', - `account_number` VARCHAR(20) NOT NULL COMMENT '계좌 번호', - `request_status` VARCHAR(50) NOT NULL DEFAULT 'PENDING' COMMENT '요청 상태', - `approved_at` TIMESTAMP NULL DEFAULT NULL COMMENT '승인 일자', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', - PRIMARY KEY (`id`), - CONSTRAINT fk_shop_order_service_requests_shop_id FOREIGN KEY (`shop_id`) REFERENCES `koin`.`shops`(`id`) ON DELETE CASCADE -); diff --git a/src/main/resources/db/migration/V227__alter_lost_item_articles_add_column_found.sql b/src/main/resources/db/migration/V227__alter_lost_item_articles_add_column_found.sql deleted file mode 100644 index 6e13549463..0000000000 --- a/src/main/resources/db/migration/V227__alter_lost_item_articles_add_column_found.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE `koin`.`lost_item_articles` - ADD COLUMN `is_found` tinyint(1) NOT NULL DEFAULT 0 COMMENT '분실물 찾음 여부' AFTER `is_deleted`, - ADD COLUMN `found_at` TIMESTAMP NULL COMMENT '분실물 찾은 시각' AFTER `is_found`; diff --git a/src/main/resources/db/migration/V228__add_organizations_table.sql b/src/main/resources/db/migration/V228__add_organizations_table.sql deleted file mode 100644 index 0d6e0995fb..0000000000 --- a/src/main/resources/db/migration/V228__add_organizations_table.sql +++ /dev/null @@ -1,16 +0,0 @@ --- organizations 테이블 생성 (단체 정보 관리) -CREATE TABLE `organizations` ( - `id` INT NOT NULL AUTO_INCREMENT, - `user_id` INT NOT NULL COMMENT '단체 계정 user_id', - `name` VARCHAR(100) NOT NULL COMMENT '단체명 (예: 총학생회, 컴퓨터공학부)', - `location` VARCHAR(255) NOT NULL COMMENT '방문 장소 (예: 학생회관 320호 총학생회 사무실)', - `is_deleted` TINYINT(1) NOT NULL DEFAULT 0, - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`), - UNIQUE KEY `uk_organizations_user_id` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='단체 정보'; - --- 초기 데이터 (총학생회) - user_id는 실제 총학생회 계정 ID로 변경 필요 --- INSERT INTO `organizations` (`user_id`, `name`, `location`) --- VALUES ({총학생회_user_id}, '총학생회', '학생회관 320호 총학생회 사무실로 방문'); diff --git a/src/main/resources/db/migration/V229__add_call_van_table.sql b/src/main/resources/db/migration/V229__add_call_van_table.sql deleted file mode 100644 index 08e8a7ce67..0000000000 --- a/src/main/resources/db/migration/V229__add_call_van_table.sql +++ /dev/null @@ -1,95 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`callvan_post` -( - `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, - `author_id` INT NOT NULL COMMENT '작성자 user_id', - `title` VARCHAR(100) NOT NULL , - `departure_type` VARCHAR(20) NOT NULL COMMENT '정문, 후문, 테니스장, 본관동, 별관동, 천안터미널, 천안역, 천안아산역, CUSTOM', - `departure_custom_name` VARCHAR(50) NULL COMMENT 'departure_type이 CUSTOM일 때 사용', - `arrival_type` VARCHAR(20) NOT NULL COMMENT '정문, 후문, 테니스장, 본관동, 별관동, 천안터미널, 천안역, 천안아산역, CUSTOM', - `arrival_custom_name` VARCHAR(50) NULL COMMENT 'arrival_type이 CUSTOM일 때 사용', - `departure_date` DATE NOT NULL, - `departure_time` TIME NOT NULL, - `max_participants` INT NOT NULL COMMENT '2~11명', - `current_participants` INT NOT NULL DEFAULT 1, - `status` VARCHAR(20) NOT NULL DEFAULT 'RECRUITING' COMMENT 'RECRUITING, CLOSED, COMPLETED', - `chat_room_id` INT NULL, - `is_deleted` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시' -); -CREATE INDEX `idx_callvan_post_status` ON `koin`.`callvan_post` (`status`); -CREATE INDEX `idx_callvan_post_departure_date_time` ON `koin`.`callvan_post` (`departure_date`, `departure_time`); -CREATE INDEX `idx_callvan_post_author_id` ON `koin`.`callvan_post` (`author_id`); -CREATE INDEX `idx_callvan_post_departure_type` ON `koin`.`callvan_post` (`departure_type`); -CREATE INDEX `idx_callvan_post_arrival_type` ON `koin`.`callvan_post` (`arrival_type`); -CREATE INDEX `idx_callvan_post_filter_composite` ON `koin`.`callvan_post` (`status`, `departure_date`, `departure_time`); -CREATE INDEX `idx_callvan_post_location_composite` ON `koin`.`callvan_post` (`departure_type`, `arrival_type`, `status`); - -CREATE TABLE IF NOT EXISTS `koin`.`callvan_participant` ( - `id` INT AUTO_INCREMENT PRIMARY KEY, - `post_id` INT NOT NULL, - `member_id` INT NOT NULL, - `role` VARCHAR(20) NOT NULL DEFAULT 'PARTICIPANT' COMMENT 'AUTHOR, PARTICIPANT', - `joined_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - `is_deleted` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시', - UNIQUE KEY `uk_participant_post_member` (`post_id`, `member_id`) -); - -CREATE INDEX `idx_participant_member_id` ON `koin`.`callvan_participant` (`member_id`); -CREATE INDEX `idx_participant_post_id` ON `koin`.`callvan_participant` (`post_id`); - -CREATE TABLE IF NOT EXISTS `koin`.`callvan_chat_room` ( - `id` INT AUTO_INCREMENT PRIMARY KEY, - `callvan_post_id` INT NOT NULL UNIQUE, - `room_name` VARCHAR(100) NOT NULL COMMENT '출발지 -> 도착지 시간 인원수 형식', - `is_deleted` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시' -); - -CREATE TABLE IF NOT EXISTS `koin`.`callvan_chat_message` ( - `id` INT AUTO_INCREMENT PRIMARY KEY, - `callvan_chat_room_id` INT NOT NULL, - `sender_id` INT NOT NULL, - `sender_nickname` VARCHAR(50) NOT NULL COMMENT '비정규화', - `message_type` VARCHAR(20) NOT NULL DEFAULT 'TEXT' COMMENT 'TEXT, IMAGE', - `content` TEXT NULL, - `is_image` TINYINT(1) NOT NULL DEFAULT '0', - `is_left_user` TINYINT(1) NOT NULL DEFAULT '0', - `is_deleted` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시' -); - -CREATE INDEX `idx_chat_message_room_created` ON `koin`.`callvan_chat_message` (`callvan_chat_room_id`, `created_at`); - -CREATE TABLE IF NOT EXISTS `koin`.`callvan_notification` ( - `id` INT AUTO_INCREMENT PRIMARY KEY, - `recipient_id` INT NOT NULL, - `notification_type` VARCHAR(30) NOT NULL COMMENT 'RECRUITMENT_COMPLETE, NEW_MESSAGE, PARTICIPANT_JOINED, DEPARTURE_IMMINENT', - - `callvan_post_id` INT NULL, - `departure_type` VARCHAR(20) NULL, - `departure_custom_name` VARCHAR(50) NULL, - `arrival_type` VARCHAR(20) NULL, - `arrival_custom_name` VARCHAR(50) NULL, - `departure_date` DATE NULL, - `departure_time` TIME NULL, - `current_participants` TINYINT NULL, - `max_participants` TINYINT NULL, - - `sender_nickname` VARCHAR(50) NULL, - `message_preview` VARCHAR(100) NULL, - `callvan_chat_room_id` INT NULL, - - `joined_member_nickname` VARCHAR(50) NULL, - - `is_read` TINYINT(1) NOT NULL DEFAULT 0, - `is_deleted` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일시', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일시' -); - -CREATE INDEX `idx_notification_recipient_read` ON `koin`.`callvan_notification` (`recipient_id`, `is_read`); diff --git a/src/main/resources/db/migration/V22__insert_timetable_frame.sql b/src/main/resources/db/migration/V22__insert_timetable_frame.sql deleted file mode 100644 index 87db47cfc9..0000000000 --- a/src/main/resources/db/migration/V22__insert_timetable_frame.sql +++ /dev/null @@ -1,3 +0,0 @@ -INSERT INTO timetable_frame (user_id, semester_id, name, is_main, is_deleted) -SELECT user_id, semester_id, '시간표1', 1, is_deleted -FROM timetables GROUP BY user_id, semester_id, is_deleted; diff --git a/src/main/resources/db/migration/V230__add_call_van_report_table.sql b/src/main/resources/db/migration/V230__add_call_van_report_table.sql deleted file mode 100644 index 12fe9fde94..0000000000 --- a/src/main/resources/db/migration/V230__add_call_van_report_table.sql +++ /dev/null @@ -1,35 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`callvan_report` -( - `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, - `callvan_post_id` INT NULL COMMENT '신고 접수된 콜벤팟 게시글 id', - `reporter_id` INT NOT NULL COMMENT '신고자 user_id', - `reported_id` INT NOT NULL COMMENT '피신고자 user_id', - `description` TEXT NULL COMMENT '신고 상세 내용(상황 설명 등)', - `status` VARCHAR(20) NOT NULL DEFAULT 'PENDING' COMMENT 'PENDING, UNDER_REVIEW, CONFIRMED, REJECTED, CANCELED', - `reviewer_id` INT NULL COMMENT '운영 검토자 user_id (Admin)', - `review_note` VARCHAR(500) NULL COMMENT '운영 메모/판단 근거', - `reviewed_at` TIMESTAMP NULL, - `confirmed_at` TIMESTAMP NULL COMMENT 'CONFIRMED 시각(누적/제재 기준 시각)', - `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - - INDEX `idx_callvan_report_status_created` (`status`, `created_at`), - INDEX `idx_callvan_report_reported_status` (`reported_id`, `status`, `confirmed_at`), - INDEX `idx_callvan_report_reporter_created` (`reporter_id`, `created_at`), - INDEX `idx_callvan_report_post` (`callvan_post_id`) -); - -CREATE TABLE IF NOT EXISTS `koin`.`callvan_report_reason` -( - `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, - `report_id` INT NOT NULL COMMENT 'callvan_report.id', - `reason_code` VARCHAR(30) NOT NULL COMMENT 'NO_SHOW, NON_PAYMENT, PROFANITY, OTHER', - `custom_text` VARCHAR(200) NULL COMMENT '기타 사유 직접 입력', - `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - - INDEX `idx_report_reason_report` (`report_id`), - INDEX `idx_report_reason_code` (`reason_code`) -); diff --git a/src/main/resources/db/migration/V231__alter_callvan_notification.sql b/src/main/resources/db/migration/V231__alter_callvan_notification.sql deleted file mode 100644 index 1c4932cc09..0000000000 --- a/src/main/resources/db/migration/V231__alter_callvan_notification.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE `koin`.`callvan_notification` - MODIFY COLUMN `current_participants` INT NULL, - MODIFY COLUMN `max_participants` INT NULL; diff --git a/src/main/resources/db/migration/V232__add_call_van_report_attachment.sql b/src/main/resources/db/migration/V232__add_call_van_report_attachment.sql deleted file mode 100644 index f27d166fce..0000000000 --- a/src/main/resources/db/migration/V232__add_call_van_report_attachment.sql +++ /dev/null @@ -1,12 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`callvan_report_attachment` -( - `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, - `report_id` INT NOT NULL COMMENT 'callvan_report.id', - `attachment_type` VARCHAR(30) NOT NULL COMMENT 'IMAGE', - `url` VARCHAR(500) NOT NULL COMMENT 'url', - `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - - INDEX `idx_report_attachment_report` (`report_id`, `is_deleted`) -); diff --git a/src/main/resources/db/migration/V233__add_callvan_report_process.sql b/src/main/resources/db/migration/V233__add_callvan_report_process.sql deleted file mode 100644 index d68c3462b3..0000000000 --- a/src/main/resources/db/migration/V233__add_callvan_report_process.sql +++ /dev/null @@ -1,15 +0,0 @@ -CREATE TABLE IF NOT EXISTS `koin`.`callvan_report_process` -( - `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, - `report_id` INT NOT NULL COMMENT 'callvan_report.id', - `processor_id` INT NOT NULL COMMENT '어드민 처리자', - `process_type` VARCHAR(50) NOT NULL COMMENT 'WARNING, TEMPORARY_RESTRICTION_14_DAYS, PERMANENT_RESTRICTION, REJECT', - `restricted_until` DATETIME NULL COMMENT '14일 제한 종료일', - `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - - INDEX `idx_callvan_report_process_report` (`report_id`, `is_deleted`), - INDEX `idx_callvan_report_process_processor` (`processor_id`, `is_deleted`), - INDEX `idx_callvan_report_process_type_until` (`process_type`, `restricted_until`, `is_deleted`) -); diff --git a/src/main/resources/db/migration/V234__add_coopshop_icon.sql b/src/main/resources/db/migration/V234__add_coopshop_icon.sql deleted file mode 100644 index d97d1ed7b7..0000000000 --- a/src/main/resources/db/migration/V234__add_coopshop_icon.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `coop_names` ADD `icon_url` VARCHAR(500) NULL AFTER `name`; diff --git a/src/main/resources/db/migration/V235__add_category_to_article_keywords.sql b/src/main/resources/db/migration/V235__add_category_to_article_keywords.sql deleted file mode 100644 index 6fcce431d5..0000000000 --- a/src/main/resources/db/migration/V235__add_category_to_article_keywords.sql +++ /dev/null @@ -1,9 +0,0 @@ -ALTER TABLE `article_keywords` - ADD COLUMN `category` VARCHAR(20) NOT NULL DEFAULT 'KOREATECH' AFTER `keyword`; - -UPDATE `article_keywords` -SET `category` = 'KOREATECH'; - -ALTER TABLE `article_keywords` - DROP INDEX `keyword`, - ADD UNIQUE KEY `uk_article_keywords_keyword_category` (`keyword`, `category`); diff --git a/src/main/resources/db/migration/V236__add_fcm_result_to_notification.sql b/src/main/resources/db/migration/V236__add_fcm_result_to_notification.sql deleted file mode 100644 index a3bbf22e24..0000000000 --- a/src/main/resources/db/migration/V236__add_fcm_result_to_notification.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE notification - ADD COLUMN is_push_success TINYINT(1) NULL COMMENT 'FCM 전송 성공 여부', - ADD COLUMN fcm_error_code VARCHAR(100) NULL COMMENT 'FCM 에러 코드', - ADD COLUMN fcm_messaging_error_code VARCHAR(100) NULL COMMENT 'FCM 메시징 에러 코드'; diff --git a/src/main/resources/db/migration/V23__add_timetable_lecture.sql b/src/main/resources/db/migration/V23__add_timetable_lecture.sql deleted file mode 100644 index ce30cb6944..0000000000 --- a/src/main/resources/db/migration/V23__add_timetable_lecture.sql +++ /dev/null @@ -1,17 +0,0 @@ -CREATE TABLE `timetable_lecture` ( - id INT UNSIGNED AUTO_INCREMENT NOT NULL comment '고유 id' primary key, - class_title VARCHAR(255) NULL comment '수업 이름', - class_time VARCHAR(255) NULL comment '강의 시간', - class_place VARCHAR(255) NULL comment '수업 장소', - professor VARCHAR(255) NULL comment '교수', - grades VARCHAR(2) not null comment '학점' default '0', - memo VARCHAR(255) NULL comment '메모', - is_deleted TINYINT(1) NULL DEFAULT 0 comment '삭제 여부', - created_at timestamp default CURRENT_TIMESTAMP not null comment '생성 일자', - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '업데이트 일자', - lectures_id INT UNSIGNED NULL comment '강의_id', - frame_id INT UNSIGNED NULL comment '시간표 프레임 id', - user_id INT UNSIGNED NULL comment '유저 id', - semester_id INT UNSIGNED NULL comment '학기 id', - CONSTRAINT FK_TIMETABLE_FRAME_ON_TIMETABLE_LECTURE FOREIGN KEY (frame_id) references `koin`.`timetable_frame`(id) on delete cascade -); diff --git a/src/main/resources/db/migration/V24__insert_timetable_lecture.sql b/src/main/resources/db/migration/V24__insert_timetable_lecture.sql deleted file mode 100644 index ecd67503df..0000000000 --- a/src/main/resources/db/migration/V24__insert_timetable_lecture.sql +++ /dev/null @@ -1,3 +0,0 @@ -INSERT INTO timetable_lecture (class_place, memo, is_deleted, user_id, semester_id) -SELECT t.class_place, t.memo, is_deleted, t.user_id, t.semester_id -FROM timetables t; diff --git a/src/main/resources/db/migration/V25__alter_timetable_lecture_lectures_id.sql b/src/main/resources/db/migration/V25__alter_timetable_lecture_lectures_id.sql deleted file mode 100644 index c87bda421b..0000000000 --- a/src/main/resources/db/migration/V25__alter_timetable_lecture_lectures_id.sql +++ /dev/null @@ -1,6 +0,0 @@ -UPDATE timetable_lecture tl - JOIN timetables t ON tl.id = t.id - JOIN lectures l ON t.class_title = l.name - AND t.class_time = l.class_time - JOIN semester s ON t.semester_id = s.id - SET tl.lectures_id = l.id; diff --git a/src/main/resources/db/migration/V26__alter_timetable_lecture_timetable_id.sql b/src/main/resources/db/migration/V26__alter_timetable_lecture_timetable_id.sql deleted file mode 100644 index ef28cceb27..0000000000 --- a/src/main/resources/db/migration/V26__alter_timetable_lecture_timetable_id.sql +++ /dev/null @@ -1,3 +0,0 @@ -UPDATE timetable_lecture t - JOIN timetable_frame f ON t.user_id = f.user_id AND t.semester_id = f.semester_id - SET t.frame_id = f.id; diff --git a/src/main/resources/db/migration/V27__delete_timetable_lecture_user_id_and_semester_id.sql b/src/main/resources/db/migration/V27__delete_timetable_lecture_user_id_and_semester_id.sql deleted file mode 100644 index 857e29d56a..0000000000 --- a/src/main/resources/db/migration/V27__delete_timetable_lecture_user_id_and_semester_id.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE timetable_lecture DROP user_id; -ALTER TABLE timetable_lecture DROP semester_id; diff --git a/src/main/resources/db/migration/V28__add_shop_bank_account_number.sql b/src/main/resources/db/migration/V28__add_shop_bank_account_number.sql deleted file mode 100644 index bf369f4dcb..0000000000 --- a/src/main/resources/db/migration/V28__add_shop_bank_account_number.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE `koin`.`shops` - ADD COLUMN `bank` VARCHAR(10) NULL DEFAULT NULL AFTER `hit`, - ADD COLUMN `account_number` VARCHAR(20) NULL DEFAULT NULL AFTER `bank`; diff --git a/src/main/resources/db/migration/V29__add_coop_shop_table.sql b/src/main/resources/db/migration/V29__add_coop_shop_table.sql deleted file mode 100644 index 751d235012..0000000000 --- a/src/main/resources/db/migration/V29__add_coop_shop_table.sql +++ /dev/null @@ -1,23 +0,0 @@ -CREATE TABLE IF NOT EXISTS coop_shop ( - id INT UNSIGNED NOT NULL COMMENT 'coop 고유 id' PRIMARY KEY AUTO_INCREMENT, - name VARCHAR(50) NOT NULL COMMENT '생협 매장 이름', - phone VARCHAR(50) COMMENT '생협 매장 연락처', - location VARCHAR(50) NOT NULL COMMENT '생협 매장 위치', - remarks TEXT COMMENT '특이사항', - is_deleted TINYINT(1) NOT NULL COMMENT '삭제 여부' DEFAULT 0, - created_at TIMESTAMP NOT NULL COMMENT '생성 일자' DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL COMMENT '업데이트 일자' DEFAULT CURRENT_TIMESTAMP -); - -CREATE TABLE IF NOT EXISTS coop_opens ( - id INT UNSIGNED NOT NULL COMMENT 'coop_open 고유 id' PRIMARY KEY AUTO_INCREMENT, - coop_id INT UNSIGNED NOT NULL COMMENT '생협 매장 id', - type VARCHAR(10) COMMENT '기타 타입(아침, 점심, 저녁)', - day_of_week VARCHAR(10) NOT NULL COMMENT '요일', - open_time VARCHAR(10) COMMENT '오픈 시간', - close_time VARCHAR(10) COMMENT '마감 시간', - is_deleted TINYINT(1) NOT NULL COMMENT '삭제 여부' DEFAULT 0, - created_at TIMESTAMP NOT NULL COMMENT '생성 일자' DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL COMMENT '업데이트 일자' DEFAULT CURRENT_TIMESTAMP, - CONSTRAINT FK_COOP_ID FOREIGN KEY (coop_id) REFERENCES coop_shop(id) ON DELETE CASCADE -); diff --git a/src/main/resources/db/migration/V2__add_notification.sql b/src/main/resources/db/migration/V2__add_notification.sql deleted file mode 100644 index 072f1ab3c8..0000000000 --- a/src/main/resources/db/migration/V2__add_notification.sql +++ /dev/null @@ -1,16 +0,0 @@ -ALTER TABLE `users` ADD COLUMN device_token VARCHAR(255); - -CREATE TABLE `notification`( - id BIGINT AUTO_INCREMENT NOT NULL comment '고유 id', - url VARCHAR(255) NOT NULL comment '앱 url', - title VARCHAR(255) NOT NULL comment '제목', - message VARCHAR(255) NOT NULL comment '메시지 내용', - image_url VARCHAR(255) NOT NULL comment '이미지 url', - `type` VARCHAR(255) NOT NULL comment '알림 타입', - users_id INT UNSIGNED NOT NULL comment '유저 id', - is_read TINYINT(1) NOT NULL comment '읽음 여부', - created_at DATETIME NULL comment '생성 일자', - updated_at DATETIME NULL comment '수정 일자', - PRIMARY KEY(`id`), - CONSTRAINT `FK_NOTIFICATION_ON_USER FOREIGN KEY` FOREIGN KEY (`users_id`) REFERENCES `users` (`id`) -); diff --git a/src/main/resources/db/migration/V30__add_shop_review.sql b/src/main/resources/db/migration/V30__add_shop_review.sql deleted file mode 100644 index 349a7974da..0000000000 --- a/src/main/resources/db/migration/V30__add_shop_review.sql +++ /dev/null @@ -1,56 +0,0 @@ -CREATE TABLE IF NOT EXISTS `shop_reviews` ( - id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, - shop_id INT UNSIGNED NOT NULL, - content TEXT NOT NULL, - rating INT NOT NULL CHECK (rating BETWEEN 0 AND 5), - reviewer_id INT UNSIGNED NOT NULL, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - FOREIGN KEY (`reviewer_id`) references `users` (`id`), - FOREIGN KEY (`shop_id`) references `shops` (`id`) -); - - -CREATE TABLE IF NOT EXISTS `shop_review_images` ( - id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, - review_id INT UNSIGNED NOT NULL, - image_urls TEXT NOT NULL, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - FOREIGN KEY (`review_id`) REFERENCES `shop_reviews`(`id`) -); - -CREATE TABLE IF NOT EXISTS `shop_review_menus` ( - id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, - review_id INT UNSIGNED NOT NULL, - menu_name TEXT NOT NULL, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - FOREIGN KEY (`review_id`) REFERENCES `shop_reviews`(`id`) -); - -CREATE TABLE IF NOT EXISTS `shop_review_reports` ( - id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, - review_id INT UNSIGNED NOT NULL, - title VARCHAR(50) NOT NULL, - content VARCHAR(255) NOT NULL, - user_id INT UNSIGNED NOT NULL, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - FOREIGN KEY (`review_id`) REFERENCES `shop_reviews`(`id`), - FOREIGN KEY (`user_id`) references `users`(`id`) -); - -CREATE TABLE IF NOT EXISTS `shop_review_reports_categories` ( - id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, - name VARCHAR(50) NOT NULL, - detail VARCHAR(255) NOT NULL, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP -); - -INSERT INTO `shop_review_reports_categories` (name, detail) VALUES -('주제에 맞지 않음', '해당 음식점과 관련 없는 리뷰입니다.'), -('스팸', '광고가 포함된 리뷰입니다.'), -('욕설', '욕설, 성적인 언어, 비방하는 글이 포함된 리뷰입니다.'), -('기타', ''); diff --git a/src/main/resources/db/migration/V31__add_coopshop_semester.sql b/src/main/resources/db/migration/V31__add_coopshop_semester.sql deleted file mode 100644 index f5a4763fec..0000000000 --- a/src/main/resources/db/migration/V31__add_coopshop_semester.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table coop_shop - add column semester varchar(50) not null comment "운영 학기"; diff --git a/src/main/resources/db/migration/V32__alter_users_collation.sql b/src/main/resources/db/migration/V32__alter_users_collation.sql deleted file mode 100644 index 2e4e6de0ed..0000000000 --- a/src/main/resources/db/migration/V32__alter_users_collation.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE users CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; diff --git a/src/main/resources/db/migration/V33__add_dining_like_table.sql b/src/main/resources/db/migration/V33__add_dining_like_table.sql deleted file mode 100644 index ccd7485a85..0000000000 --- a/src/main/resources/db/migration/V33__add_dining_like_table.sql +++ /dev/null @@ -1,7 +0,0 @@ -CREATE TABLE IF NOT EXISTS dining_likes ( - id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, - dining_id INT NOT NULL, - user_id INT NOT NULL -); - -ALTER TABLE `dining_menus` ADD COLUMN `likes` INT DEFAULT 0; \ No newline at end of file diff --git a/src/main/resources/db/migration/V34__shop_reviews_restrict_change_cascade_.sql b/src/main/resources/db/migration/V34__shop_reviews_restrict_change_cascade_.sql deleted file mode 100644 index f20d414b26..0000000000 --- a/src/main/resources/db/migration/V34__shop_reviews_restrict_change_cascade_.sql +++ /dev/null @@ -1,13 +0,0 @@ -ALTER TABLE `koin`.`shop_reviews` - DROP FOREIGN KEY `shop_reviews_ibfk_1`, - DROP FOREIGN KEY `shop_reviews_ibfk_2`; - -ALTER TABLE `koin`.`shop_reviews` - ADD CONSTRAINT `shop_reviews_ibfk_1` - FOREIGN KEY (`reviewer_id`) - REFERENCES `koin`.`users` (`id`) - ON DELETE CASCADE, - ADD CONSTRAINT `shop_reviews_ibfk_2` - FOREIGN KEY (`shop_id`) - REFERENCES `koin`.`shops` (`id`) - ON DELETE CASCADE; diff --git a/src/main/resources/db/migration/V35__shop_review_reports_restrict_change_cascade_.sql b/src/main/resources/db/migration/V35__shop_review_reports_restrict_change_cascade_.sql deleted file mode 100644 index 47ed89f0fd..0000000000 --- a/src/main/resources/db/migration/V35__shop_review_reports_restrict_change_cascade_.sql +++ /dev/null @@ -1,13 +0,0 @@ -ALTER TABLE `koin`.`shop_review_reports` - DROP FOREIGN KEY `shop_review_reports_ibfk_1`, - DROP FOREIGN KEY `shop_review_reports_ibfk_2`; - -ALTER TABLE `koin`.`shop_review_reports` - ADD CONSTRAINT `shop_review_reports_ibfk_1` - FOREIGN KEY (`review_id`) - REFERENCES `koin`.`shop_reviews` (`id`) - ON DELETE CASCADE, - ADD CONSTRAINT `shop_review_reports_ibfk_2` - FOREIGN KEY (`user_id`) - REFERENCES `koin`.`users` (`id`) - ON DELETE CASCADE; diff --git a/src/main/resources/db/migration/V36__shop_review_images_restrict_change_cascade_.sql b/src/main/resources/db/migration/V36__shop_review_images_restrict_change_cascade_.sql deleted file mode 100644 index b3261292be..0000000000 --- a/src/main/resources/db/migration/V36__shop_review_images_restrict_change_cascade_.sql +++ /dev/null @@ -1,8 +0,0 @@ -ALTER TABLE `koin`.`shop_review_images` - DROP FOREIGN KEY `shop_review_images_ibfk_1`; - -ALTER TABLE `koin`.`shop_review_images` - ADD CONSTRAINT `shop_review_images_ibfk_1` - FOREIGN KEY (`review_id`) - REFERENCES `koin`.`shop_reviews` (`id`) - ON DELETE CASCADE; diff --git a/src/main/resources/db/migration/V37__shop_review_menus_restrict_change_cascade_.sql b/src/main/resources/db/migration/V37__shop_review_menus_restrict_change_cascade_.sql deleted file mode 100644 index 3d7ef6a6e4..0000000000 --- a/src/main/resources/db/migration/V37__shop_review_menus_restrict_change_cascade_.sql +++ /dev/null @@ -1,8 +0,0 @@ -ALTER TABLE `koin`.`shop_review_menus` - DROP FOREIGN KEY `shop_review_menus_ibfk_1`; - -ALTER TABLE `koin`.`shop_review_menus` - ADD CONSTRAINT `shop_review_menus_ibfk_1` - FOREIGN KEY (`review_id`) - REFERENCES `koin`.`shop_reviews` (`id`) - ON DELETE CASCADE; diff --git a/src/main/resources/db/migration/V38__add_shop_review_soft_delete_.sql b/src/main/resources/db/migration/V38__add_shop_review_soft_delete_.sql deleted file mode 100644 index ffa26ddf6c..0000000000 --- a/src/main/resources/db/migration/V38__add_shop_review_soft_delete_.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `shop_reviews` ADD COLUMN `is_deleted` tinyint(1) default 0; diff --git a/src/main/resources/db/migration/V39__add_shop_review_report_status_.sql b/src/main/resources/db/migration/V39__add_shop_review_report_status_.sql deleted file mode 100644 index e690df8492..0000000000 --- a/src/main/resources/db/migration/V39__add_shop_review_report_status_.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `shop_review_reports` ADD COLUMN `status` varchar(25) default 'UNHANDLED'; diff --git a/src/main/resources/db/migration/V3__alter_diningmenus_soldout.sql b/src/main/resources/db/migration/V3__alter_diningmenus_soldout.sql deleted file mode 100644 index bfed0858d8..0000000000 --- a/src/main/resources/db/migration/V3__alter_diningmenus_soldout.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `dining_menus` ADD COLUMN sold_out BOOLEAN NOT NULL DEFAULT FALSE diff --git a/src/main/resources/db/migration/V40__alter_review_content_nullable_.sql b/src/main/resources/db/migration/V40__alter_review_content_nullable_.sql deleted file mode 100644 index 170f3a4400..0000000000 --- a/src/main/resources/db/migration/V40__alter_review_content_nullable_.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `shop_review_reports` MODIFY `content` text NULL; diff --git a/src/main/resources/db/migration/V41__add_dining_menus_price_column.sql b/src/main/resources/db/migration/V41__add_dining_menus_price_column.sql deleted file mode 100644 index 4250eb99f6..0000000000 --- a/src/main/resources/db/migration/V41__add_dining_menus_price_column.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE dining_menus - ADD COLUMN price INT UNSIGNED; diff --git a/src/main/resources/db/migration/V42__delete_users_auth_token_auth_expried_at.sql b/src/main/resources/db/migration/V42__delete_users_auth_token_auth_expried_at.sql deleted file mode 100644 index 694249133c..0000000000 --- a/src/main/resources/db/migration/V42__delete_users_auth_token_auth_expried_at.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE users - DROP COLUMN auth_token, - DROP COLUMN auth_expired_at; diff --git a/src/main/resources/db/migration/V43__drop_unused_tables_and_column.sql b/src/main/resources/db/migration/V43__drop_unused_tables_and_column.sql deleted file mode 100644 index 6838180f10..0000000000 --- a/src/main/resources/db/migration/V43__drop_unused_tables_and_column.sql +++ /dev/null @@ -1,30 +0,0 @@ -DROP TABLE IF EXISTS shop_view_logs; -DROP TABLE IF EXISTS test; -DROP TABLE IF EXISTS temp_comments; -DROP TABLE IF EXISTS temp_articles; -DROP TABLE IF EXISTS surveys; -DROP TABLE IF EXISTS survey_view_logs; -DROP TABLE IF EXISTS survey_answers; -DROP TABLE IF EXISTS survey_questions; -DROP TABLE IF EXISTS lost_item_comments; -DROP TABLE IF EXISTS lost_items; -DROP TABLE IF EXISTS lost_item_view_logs; -DROP TABLE IF EXISTS land_comments; -DROP TABLE IF EXISTS item_view_logs; -DROP TABLE IF EXISTS items; -DROP TABLE IF EXISTS item_comments; -DROP TABLE IF EXISTS integrated_assessments; -DROP TABLE IF EXISTS holidays; -DROP TABLE IF EXISTS faqs; -DROP TABLE IF EXISTS failed_jobs; -DROP TABLE IF EXISTS calendar_universities; -DROP TABLE IF EXISTS callvan_companies; -DROP TABLE IF EXISTS callvan_participants; -DROP TABLE IF EXISTS callvan_rooms; -DROP TABLE IF EXISTS circles; -DROP TABLE IF EXISTS dept_nums; -DROP TABLE IF EXISTS event_comments; -DROP TABLE IF EXISTS dept_infos; - -ALTER TABLE owners -DROP COLUMN company_registration_certificate_image_url; diff --git a/src/main/resources/db/migration/V44__add_keyword_notification.sql b/src/main/resources/db/migration/V44__add_keyword_notification.sql deleted file mode 100644 index bf4c45a2c1..0000000000 --- a/src/main/resources/db/migration/V44__add_keyword_notification.sql +++ /dev/null @@ -1,22 +0,0 @@ -CREATE TABLE `article_keywords` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `keyword` VARCHAR(50) NOT NULL UNIQUE, - `last_used_at` TIMESTAMP NULL, - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`) -); - -CREATE TABLE `article_keyword_user_map` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `keyword_id` INT UNSIGNED NOT NULL, - `user_id` INT UNSIGNED NOT NULL, - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`), - FOREIGN KEY (`keyword_id`) REFERENCES `article_keywords` (`id`) ON DELETE CASCADE, - FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE, - UNIQUE KEY `uk_keyword_user` (`keyword_id`, `user_id`) -); diff --git a/src/main/resources/db/migration/V45__alter_notification_add_url_column.sql b/src/main/resources/db/migration/V45__alter_notification_add_url_column.sql deleted file mode 100644 index 7e6daa7d75..0000000000 --- a/src/main/resources/db/migration/V45__alter_notification_add_url_column.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE notification - ADD COLUMN scheme_uri VARCHAR(255); diff --git a/src/main/resources/db/migration/V46__alter_boards_and_article_notices.sql b/src/main/resources/db/migration/V46__alter_boards_and_article_notices.sql deleted file mode 100644 index 93e5312043..0000000000 --- a/src/main/resources/db/migration/V46__alter_boards_and_article_notices.sql +++ /dev/null @@ -1,12 +0,0 @@ -ALTER TABLE `boards` - DROP COLUMN tag, - DROP COLUMN seq; - -ALTER TABLE `notice_articles` - RENAME TO `koreatech_articles`, - DROP COLUMN has_notice, - CHANGE COLUMN permalink url VARCHAR(255) NOT NULL COMMENT '기존 게시글 url', - ADD COLUMN `is_notice` tinyint(1) NOT NULL DEFAULT '0' COMMENT '공지사항인지 여부', - ADD COLUMN `koin_hit` int unsigned NOT NULL DEFAULT '0' COMMENT '코인 조회수', - DROP INDEX ux_notice_article, - ADD CONSTRAINT ux_koreatech_article UNIQUE (board_id, article_num); diff --git a/src/main/resources/db/migration/V47__insert_board_to_boards.sql b/src/main/resources/db/migration/V47__insert_board_to_boards.sql deleted file mode 100644 index 03e7391086..0000000000 --- a/src/main/resources/db/migration/V47__insert_board_to_boards.sql +++ /dev/null @@ -1,3 +0,0 @@ -INSERT INTO `boards` (name, is_notice) VALUES - ('현장실습공지', 1), - ('학생생활', 0); diff --git a/src/main/resources/db/migration/V48__add_article_attachments.sql b/src/main/resources/db/migration/V48__add_article_attachments.sql deleted file mode 100644 index dde8d93f97..0000000000 --- a/src/main/resources/db/migration/V48__add_article_attachments.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE `article_attachments` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `article_id` INT UNSIGNED NOT NULL, - `hash` BINARY(32) NOT NULL, - `url` TEXT NOT NULL, - `name` TEXT NOT NULL, - `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`), - UNIQUE KEY ux_article_attachment (`article_id`, `hash`), - FOREIGN KEY (`article_id`) REFERENCES `koreatech_articles` (`id`) ON DELETE CASCADE -); diff --git a/src/main/resources/db/migration/V49__update_article_is_notice.sql b/src/main/resources/db/migration/V49__update_article_is_notice.sql deleted file mode 100644 index 41a81390f0..0000000000 --- a/src/main/resources/db/migration/V49__update_article_is_notice.sql +++ /dev/null @@ -1,3 +0,0 @@ -UPDATE koreatech_articles a - JOIN boards b ON a.board_id = b.id - SET a.is_notice = b.is_notice; diff --git a/src/main/resources/db/migration/V4__alter_diningmenus_imageupload.sql b/src/main/resources/db/migration/V4__alter_diningmenus_imageupload.sql deleted file mode 100644 index 874d1b0d0d..0000000000 --- a/src/main/resources/db/migration/V4__alter_diningmenus_imageupload.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `dining_menus` ADD COLUMN image_url varchar(255) AFTER menu; - diff --git a/src/main/resources/db/migration/V50__add_article_search_logs.sql b/src/main/resources/db/migration/V50__add_article_search_logs.sql deleted file mode 100644 index 839ae31ebc..0000000000 --- a/src/main/resources/db/migration/V50__add_article_search_logs.sql +++ /dev/null @@ -1,24 +0,0 @@ -CREATE TABLE article_search_keywords -( - id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, - keyword VARCHAR(255) NOT NULL, - weight DOUBLE NOT NULL DEFAULT 1.0, - last_searched_at TIMESTAMP NULL, - total_searches INT UNSIGNED NOT NULL DEFAULT 0, - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - INDEX idx_keyword (keyword), - INDEX idx_last_searched_at (last_searched_at) -); - -CREATE TABLE article_search_keyword_ip_map -( - id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, - keyword_id INT UNSIGNED NOT NULL, - ip_address VARCHAR(45) NOT NULL, - search_count INT UNSIGNED NOT NULL DEFAULT 1, - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - FOREIGN KEY (keyword_id) REFERENCES article_search_keywords (id), - INDEX idx_ip_address (ip_address) -); diff --git a/src/main/resources/db/migration/V51__update_coopshop_semester.sql b/src/main/resources/db/migration/V51__update_coopshop_semester.sql deleted file mode 100644 index efb2a8a5d9..0000000000 --- a/src/main/resources/db/migration/V51__update_coopshop_semester.sql +++ /dev/null @@ -1,2 +0,0 @@ -UPDATE coop_shop - SET semester = "학기 중" WHERE id = 1; diff --git a/src/main/resources/db/migration/V52__update_coopshop_semester_typo.sql b/src/main/resources/db/migration/V52__update_coopshop_semester_typo.sql deleted file mode 100644 index f236c81298..0000000000 --- a/src/main/resources/db/migration/V52__update_coopshop_semester_typo.sql +++ /dev/null @@ -1,2 +0,0 @@ -UPDATE coop_shop - SET semester = "학기" WHERE id = 1; diff --git a/src/main/resources/db/migration/V53__update_koreatech_articles_registered_at.sql b/src/main/resources/db/migration/V53__update_koreatech_articles_registered_at.sql deleted file mode 100644 index 7670937763..0000000000 --- a/src/main/resources/db/migration/V53__update_koreatech_articles_registered_at.sql +++ /dev/null @@ -1,18 +0,0 @@ -SET SQL_SAFE_UPDATES = 0; - -UPDATE koin.koreatech_articles -SET registered_at = - CASE - WHEN registered_at REGEXP '^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$' - THEN STR_TO_DATE(registered_at, '%Y-%m-%d %H:%i:%s') - WHEN registered_at REGEXP '^[0-9]{2}\.[0-9]{2}\.[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$' - THEN STR_TO_DATE(registered_at, '%y.%m.%d %H:%i:%s') - WHEN registered_at REGEXP '^[0-9]{4}-[0-9]{2}-[0-9]{2}$' - THEN STR_TO_DATE(CONCAT(registered_at, ' 00:00:00'), '%Y-%m-%d %H:%i:%s') - ELSE registered_at - END; - -SET SQL_SAFE_UPDATES = 1; - -ALTER TABLE koin.koreatech_articles - MODIFY COLUMN `registered_at` DATETIME DEFAULT NULL COMMENT '등록 일자'; diff --git a/src/main/resources/db/migration/V54__create_index_registered_at_and_id.sql b/src/main/resources/db/migration/V54__create_index_registered_at_and_id.sql deleted file mode 100644 index eb474b87b4..0000000000 --- a/src/main/resources/db/migration/V54__create_index_registered_at_and_id.sql +++ /dev/null @@ -1,16 +0,0 @@ -SET @index_exists = ( - SELECT COUNT(1) - FROM information_schema.statistics - WHERE table_schema = 'koin' - AND table_name = 'koreatech_articles' - AND index_name = 'idx_registered_at_id' -); - -SET @create_index_sql = IF(@index_exists = 0, - 'CREATE INDEX idx_registered_at_id ON koin.koreatech_articles (registered_at DESC, id DESC)', - 'SELECT ''Index already exists'' AS message' -); - -PREPARE stmt FROM @create_index_sql; -EXECUTE stmt; -DEALLOCATE PREPARE stmt; diff --git a/src/main/resources/db/migration/V55__add_abtest_tables.sql b/src/main/resources/db/migration/V55__add_abtest_tables.sql deleted file mode 100644 index 2a63e04d9b..0000000000 --- a/src/main/resources/db/migration/V55__add_abtest_tables.sql +++ /dev/null @@ -1,61 +0,0 @@ -CREATE TABLE `device` -( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `user_id` int unsigned NOT NULL, - `model` varchar(100) DEFAULT NULL, - `type` varchar(100) DEFAULT NULL, - `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`) -); - -CREATE TABLE `access_history` -( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `device_id` int unsigned DEFAULT NULL, - `last_accessed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`) -); - -CREATE TABLE `abtest_variable` -( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `abtest_id` int unsigned NOT NULL, - `name` varchar(255) NOT NULL, - `display_name` varchar(255) NOT NULL, - `rate` int unsigned NOT NULL, - `count` int NOT NULL DEFAULT '0', - `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`) -); - -CREATE TABLE `access_history_abtest_variable` -( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `access_history_id` int unsigned NOT NULL, - `variable_id` int unsigned NOT NULL, - `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`) -); - -CREATE TABLE `abtest` -( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `title` varchar(255) NOT NULL, - `display_title` varchar(255) NOT NULL, - `description` varchar(255) DEFAULT NULL, - `creator` varchar(50) DEFAULT NULL, - `team` varchar(50) DEFAULT NULL, - `winner_id` int unsigned DEFAULT NULL, - `status` varchar(50) NOT NULL DEFAULT 'IN_PROGRESS', - `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`), - constraint title_UNIQUE - unique (`title`) -); - diff --git a/src/main/resources/db/migration/V56__add_abtest_tables_fk.sql b/src/main/resources/db/migration/V56__add_abtest_tables_fk.sql deleted file mode 100644 index 2f59c908f1..0000000000 --- a/src/main/resources/db/migration/V56__add_abtest_tables_fk.sql +++ /dev/null @@ -1,58 +0,0 @@ -ALTER TABLE `koin`.`device` - ADD INDEX `FK_DEVICE_ON_USER_ID_idx` (`user_id` ASC) VISIBLE; -; -ALTER TABLE `koin`.`device` - ADD CONSTRAINT `FK_DEVICE_ON_USER_ID` - FOREIGN KEY (`user_id`) - REFERENCES `koin`.`users` (`id`) - ON DELETE NO ACTION - ON UPDATE NO ACTION; - -ALTER TABLE `koin`.`access_history` - ADD INDEX `FK_ACCESS_HISTORY_ON_DEVICE_ID_idx` (`device_id` ASC) VISIBLE; - -ALTER TABLE `koin`.`access_history` - ADD CONSTRAINT `FK_ACCESS_HISTORY_ON_DEVICE_ID` - FOREIGN KEY (`device_id`) - REFERENCES `koin`.`device` (`id`) - ON DELETE NO ACTION - ON UPDATE NO ACTION; - - -ALTER TABLE `koin`.`access_history_abtest_variable` - ADD INDEX `FK_ACCESS_HISTORY_ABTEST_VARIABLE_ON_ACCESS_HISTORY_ID_idx` (`access_history_id` ASC) VISIBLE, -ADD INDEX `FK_ACCESS_HISTORY_ABTEST_VARIABLE_ON_ACCESS_VARIABLE_ID_idx` (`variable_id` ASC) VISIBLE; -; -ALTER TABLE `koin`.`access_history_abtest_variable` - ADD CONSTRAINT `FK_ACCESS_HISTORY_ABTEST_VARIABLE_ON_ACCESS_HISTORY_ID` - FOREIGN KEY (`access_history_id`) - REFERENCES `koin`.`access_history` (`id`) - ON DELETE NO ACTION - ON UPDATE NO ACTION, -ADD CONSTRAINT `FK_ACCESS_HISTORY_ABTEST_VARIABLE_ON_ACCESS_VARIABLE_ID` - FOREIGN KEY (`variable_id`) - REFERENCES `koin`.`abtest_variable` (`id`) - ON DELETE NO ACTION - ON UPDATE NO ACTION; - - -ALTER TABLE `koin`.`abtest_variable` - ADD INDEX `FK_ABTEST_VARIABLE_ON_ABTEST_ID_idx` (`abtest_id` ASC) VISIBLE; -; -ALTER TABLE `koin`.`abtest_variable` - ADD CONSTRAINT `FK_ABTEST_VARIABLE_ON_ABTEST_ID` - FOREIGN KEY (`abtest_id`) - REFERENCES `koin`.`abtest` (`id`) - ON DELETE NO ACTION - ON UPDATE NO ACTION; - - -ALTER TABLE `koin`.`abtest` - ADD INDEX `FK_ABTEST_ON_WINNER_ID_idx` (`winner_id` ASC) VISIBLE; -; -ALTER TABLE `koin`.`abtest` - ADD CONSTRAINT `FK_ABTEST_ON_WINNER_ID` - FOREIGN KEY (`winner_id`) - REFERENCES `koin`.`abtest_variable` (`id`) - ON DELETE NO ACTION - ON UPDATE NO ACTION; diff --git a/src/main/resources/db/migration/V57__alter_articles_table_fulltext_index.sql b/src/main/resources/db/migration/V57__alter_articles_table_fulltext_index.sql deleted file mode 100644 index 49a9276fa1..0000000000 --- a/src/main/resources/db/migration/V57__alter_articles_table_fulltext_index.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE FULLTEXT INDEX idx_fulltext_title ON koreatech_articles (title) WITH PARSER ngram; diff --git a/src/main/resources/db/migration/V58__add_benefit_table.sql b/src/main/resources/db/migration/V58__add_benefit_table.sql deleted file mode 100644 index 2200140f96..0000000000 --- a/src/main/resources/db/migration/V58__add_benefit_table.sql +++ /dev/null @@ -1,17 +0,0 @@ -CREATE TABLE IF NOT EXISTS shop_benefit_categories ( - id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, - title VARCHAR(60) NOT NULL, - detail VARCHAR(255), - created_at timestamp default CURRENT_TIMESTAMP not null, - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP -); - -CREATE TABLE IF NOT EXISTS shop_benefit_category_map ( - id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, - shop_id INT UNSIGNED NOT NULL, - benefit_id INT UNSIGNED NOT NULL, - created_at timestamp default CURRENT_TIMESTAMP not null, - updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP, - FOREIGN KEY (`shop_id`) references `shops` (`id`), - FOREIGN KEY (`benefit_id`) references `shop_benefit_categories` (`id`) -); diff --git a/src/main/resources/db/migration/V59__insert_benefit_category.sql b/src/main/resources/db/migration/V59__insert_benefit_category.sql deleted file mode 100644 index d5e44b9ddd..0000000000 --- a/src/main/resources/db/migration/V59__insert_benefit_category.sql +++ /dev/null @@ -1,14 +0,0 @@ -INSERT INTO shop_benefit_categories (title, detail) VALUES -('배달비 아끼기', '계좌이체하면 배달비가 무료(할인)인 상점들을 모아뒀어요.'), -('최소주문금액 무료', '계좌이체하면 최소주문금액이 무료인 상점들을 모아뒀어요.'), -('서비스 증정', '계좌이체하면 서비스를 주는 상점들을 모아뒀어요.'), -('가게까지 픽업', '사장님께서 직접 가게까지 데려다주시는 상점들을 모아뒀어요.'); - -INSERT INTO shop_benefit_category_map (shop_id, benefit_id) VALUES -(11, 1), -(11, 1), -(13, 2), -(13, 3), -(11, 3), -(11, 3), -(13, 4); diff --git a/src/main/resources/db/migration/V5__add_notification_subscribe_table.sql b/src/main/resources/db/migration/V5__add_notification_subscribe_table.sql deleted file mode 100644 index 8193333e5a..0000000000 --- a/src/main/resources/db/migration/V5__add_notification_subscribe_table.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE `notification_subscribe` -( - id BIGINT AUTO_INCREMENT NOT NULL, - created_at datetime NOT NULL, - updated_at datetime NOT NULL, - subscribe_type VARCHAR(255) NOT NULL, - user_id INT UNSIGNED NOT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `FK_NOTIFICATION_SUBSCRIBE_ON_USER` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) -); diff --git a/src/main/resources/db/migration/V60__alter_search_keywords_and_ip_map_unique_cascade.sql b/src/main/resources/db/migration/V60__alter_search_keywords_and_ip_map_unique_cascade.sql deleted file mode 100644 index b2965a3233..0000000000 --- a/src/main/resources/db/migration/V60__alter_search_keywords_and_ip_map_unique_cascade.sql +++ /dev/null @@ -1,9 +0,0 @@ -ALTER TABLE `article_search_keywords` - MODIFY COLUMN `keyword` VARCHAR(255) NOT NULL UNIQUE; - -ALTER TABLE article_search_keyword_ip_map - ADD CONSTRAINT unique_keyword_ip UNIQUE (keyword_id, ip_address), - ADD CONSTRAINT fk_keyword_id - FOREIGN KEY (keyword_id) - REFERENCES article_search_keywords (id) - ON DELETE CASCADE; diff --git a/src/main/resources/db/migration/V61__alter_version_table.sql b/src/main/resources/db/migration/V61__alter_version_table.sql deleted file mode 100644 index 96cfe3c29a..0000000000 --- a/src/main/resources/db/migration/V61__alter_version_table.sql +++ /dev/null @@ -1,17 +0,0 @@ -ALTER TABLE `versions` - ADD COLUMN ( - `title` VARCHAR(255) COMMENT '업데이트 문구 제목', - `is_previous` tinyint NOT NULL DEFAULT 0 COMMENT '지난 버전 여부' - ), - DROP CONSTRAINT `versions_type_unique` -; - -CREATE TABLE `version_contents` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, - `version_id` INT UNSIGNED NOT NULL COMMENT '업데이트 문구 소제목', - `title` VARCHAR(255) COMMENT '업데이트 문구 본문', - `content` TEXT, - `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - FOREIGN KEY (`version_id`) REFERENCES versions (`id`) -); diff --git a/src/main/resources/db/migration/V62__insert_version_content.sql b/src/main/resources/db/migration/V62__insert_version_content.sql deleted file mode 100644 index 1c25bb6acb..0000000000 --- a/src/main/resources/db/migration/V62__insert_version_content.sql +++ /dev/null @@ -1 +0,0 @@ -INSERT INTO `versions` (`type`, `version`, `is_previous`) VALUES ('ios', '3.1.0', 0); diff --git a/src/main/resources/db/migration/V63__alter_table_versions_alter_column_is_previous.sql b/src/main/resources/db/migration/V63__alter_table_versions_alter_column_is_previous.sql deleted file mode 100644 index 2a95e664d4..0000000000 --- a/src/main/resources/db/migration/V63__alter_table_versions_alter_column_is_previous.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE versions - MODIFY COLUMN `is_previous` TINYINT(1); diff --git a/src/main/resources/db/migration/V64__alter_benefit_category_on_off_image_url.sql b/src/main/resources/db/migration/V64__alter_benefit_category_on_off_image_url.sql deleted file mode 100644 index d43996f12b..0000000000 --- a/src/main/resources/db/migration/V64__alter_benefit_category_on_off_image_url.sql +++ /dev/null @@ -1,27 +0,0 @@ -ALTER TABLE shop_benefit_categories - ADD COLUMN on_image_url VARCHAR(255) NULL COMMENT '혜택 카테고리 on 이미지 url', - ADD COLUMN off_image_url VARCHAR(255) NULL COMMENT '혜택 카테고리 off 이미지 url'; - -UPDATE shop_benefit_categories -SET on_image_url = 'https://stage-static.koreatech.in/shop/benefit/deliveryOn.png', - off_image_url = 'https://stage-static.koreatech.in/shop/benefit/deliveryOff.png' -WHERE title = '배달비 아끼기'; - -UPDATE shop_benefit_categories -SET on_image_url = 'https://stage-static.koreatech.in/shop/benefit/paidOn.png', - off_image_url = 'https://stage-static.koreatech.in/shop/benefit/paidOff.png' -WHERE title = '최소주문금액 무료'; - -UPDATE shop_benefit_categories -SET on_image_url = 'https://stage-static.koreatech.in/shop/benefit/serviceOn.png', - off_image_url = 'https://stage-static.koreatech.in/shop/benefit/serviceOff.png' -WHERE title = '서비스 증정'; - -UPDATE shop_benefit_categories -SET on_image_url = 'https://stage-static.koreatech.in/shop/benefit/pickUpOn.png', - off_image_url = 'https://stage-static.koreatech.in/shop/benefit/pickUpOff.png' -WHERE title = '가게까지 픽업'; - -ALTER TABLE shop_benefit_categories - MODIFY COLUMN on_image_url VARCHAR (255) NOT NULL, - MODIFY COLUMN off_image_url VARCHAR (255) NOT NULL; diff --git a/src/main/resources/db/migration/V65__alter_version_table_and_delete_content_table.sql b/src/main/resources/db/migration/V65__alter_version_table_and_delete_content_table.sql deleted file mode 100644 index a67d3291da..0000000000 --- a/src/main/resources/db/migration/V65__alter_version_table_and_delete_content_table.sql +++ /dev/null @@ -1,4 +0,0 @@ -DROP TABLE `version_contents`; - -ALTER TABLE `versions` - ADD COLUMN `content` TEXT; diff --git a/src/main/resources/db/migration/V66__modify_column_timetable_lecture_text.sql b/src/main/resources/db/migration/V66__modify_column_timetable_lecture_text.sql deleted file mode 100644 index aa456deb55..0000000000 --- a/src/main/resources/db/migration/V66__modify_column_timetable_lecture_text.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE timetable_lecture - MODIFY COLUMN class_time TEXT; diff --git a/src/main/resources/db/migration/V67__create_new_articles_tables.sql b/src/main/resources/db/migration/V67__create_new_articles_tables.sql deleted file mode 100644 index 607ccdd98a..0000000000 --- a/src/main/resources/db/migration/V67__create_new_articles_tables.sql +++ /dev/null @@ -1,41 +0,0 @@ -CREATE TABLE `koin`.`new_articles` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'notice articles 고유 id', - `board_id` INT UNSIGNED NOT NULL COMMENT '게시판 고유 id', - `title` VARCHAR(255) CHARACTER SET 'utf8mb4' NOT NULL COMMENT '제목', - `content` MEDIUMTEXT CHARACTER SET 'utf8mb4' NULL DEFAULT NULL COMMENT '내용', - `hit` INT UNSIGNED NOT NULL DEFAULT '0' COMMENT '조회수', - `is_notice` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '공지사항인지 여부', - `is_deleted` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', - PRIMARY KEY (`id`) -); - -CREATE TABLE `koin`.`new_koin_articles` -( - `id` INT NOT NULL AUTO_INCREMENT, - `article_id` INT UNSIGNED NOT NULL, - `user_id` INT UNSIGNED NULL, - `is_deleted` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', - PRIMARY KEY (`id`), - UNIQUE INDEX `article_id_UNIQUE` (`article_id` ASC) VISIBLE -); - -CREATE TABLE `koin`.`new_koreatech_articles` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'notice articles 고유 id', - `article_id` INT UNSIGNED NOT NULL, - `author` VARCHAR(50) CHARACTER SET 'utf8mb4' NOT NULL COMMENT '작성자', - `portal_num` INT UNSIGNED NOT NULL COMMENT '게시물 번호', - `portal_hit` INT UNSIGNED NOT NULL DEFAULT '0', - `url` VARCHAR(255) CHARACTER SET 'utf8mb4' NOT NULL COMMENT '기존 게시글 url', - `registered_at` DATETIME NULL DEFAULT NULL COMMENT '등록 일자', - `is_deleted` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '삭제 여부', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', - PRIMARY KEY (`id`), - UNIQUE INDEX `article_id_UNIQUE` (`article_id` ASC) VISIBLE -); diff --git a/src/main/resources/db/migration/V68__move_articles_data.sql b/src/main/resources/db/migration/V68__move_articles_data.sql deleted file mode 100644 index f922fee673..0000000000 --- a/src/main/resources/db/migration/V68__move_articles_data.sql +++ /dev/null @@ -1,28 +0,0 @@ --- new_articles 테이블에 old_id 추가 -ALTER TABLE `koin`.`new_articles` - ADD COLUMN `old_id` INT NULL DEFAULT '0'; - --- articles 데이터를 new_articles로 이관하면서 old_id 저장 -INSERT INTO `koin`.`new_articles` (board_id, title, content, hit, is_notice, is_deleted, created_at, updated_at, old_id) -SELECT board_id, - title, - content, - hit, - is_notice, - is_deleted, - created_at, - updated_at, - a.id -FROM `koin`.`articles` a -WHERE a.board_id NOT IN (5, 6, 7, 8); - --- new_koin_articles에 new_articles.old_id를 매핑하여 article_id를 삽입 -INSERT INTO `koin`.`new_koin_articles` (article_id, user_id, is_deleted, created_at, updated_at) -SELECT na.id, a.user_id, a.is_deleted, a.created_at, a.updated_at -FROM `koin`.`articles` a - JOIN `koin`.`new_articles` na ON a.id = na.old_id -WHERE a.board_id NOT IN (5, 6, 7, 8); - --- new_articles에서 old_id 컬럼 삭제 -ALTER TABLE `koin`.`new_articles` -DROP COLUMN old_id; diff --git a/src/main/resources/db/migration/V69__move_koreatech_articles_data.sql b/src/main/resources/db/migration/V69__move_koreatech_articles_data.sql deleted file mode 100644 index 8f096533f1..0000000000 --- a/src/main/resources/db/migration/V69__move_koreatech_articles_data.sql +++ /dev/null @@ -1,33 +0,0 @@ --- new_articles 테이블에 old_id 추가 -ALTER TABLE `koin`.`new_articles` - ADD COLUMN `old_id` INT NULL DEFAULT '0'; - --- koreatech_articles 데이터를 new_articles로 이관하면서 old_id 저장 -INSERT INTO `koin`.`new_articles` (board_id, title, content, hit, is_notice, is_deleted, created_at, updated_at, old_id) -SELECT ka.board_id, - ka.title, - ka.content, - ka.hit, - ka.is_notice, - ka.is_deleted, - ka.created_at, - ka.updated_at, - ka.id -FROM `koin`.`koreatech_articles` ka -ORDER BY ka.registered_at ASC, ka.id ASC; - --- koreatech_articles 데이터를 new_koreatech_articles로 이관하면서 old_id 저장 -INSERT INTO `koin`.`new_koreatech_articles` (article_id, author, portal_num, portal_hit, url, registered_at, is_deleted, - created_at, updated_at) -SELECT na.id, - ka.author, - ka.article_num, - ka.hit, - ka.url, - ka.registered_at, - ka.is_deleted, - ka.created_at, - ka.updated_at -FROM `koin`.`koreatech_articles` ka - JOIN `koin`.`new_articles` na ON ka.id = na.old_id -ORDER BY ka.registered_at ASC, ka.id ASC; diff --git a/src/main/resources/db/migration/V6__alter_diningmenus_updated.sql b/src/main/resources/db/migration/V6__alter_diningmenus_updated.sql deleted file mode 100644 index 77682be498..0000000000 --- a/src/main/resources/db/migration/V6__alter_diningmenus_updated.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `dining_menus` ADD COLUMN is_changed BOOLEAN NOT NULL DEFAULT FALSE diff --git a/src/main/resources/db/migration/V70__update_article_attachments_article_id.sql b/src/main/resources/db/migration/V70__update_article_attachments_article_id.sql deleted file mode 100644 index 131185082f..0000000000 --- a/src/main/resources/db/migration/V70__update_article_attachments_article_id.sql +++ /dev/null @@ -1,14 +0,0 @@ --- articles_attachments.article_id 최신화 -SET FOREIGN_KEY_CHECKS = 0; -SET SQL_SAFE_UPDATES = 0; - -UPDATE `koin`.`article_attachments` a - JOIN `koin`.`new_articles` na ON a.article_id = na.old_id - SET a.article_id = na.id; - -SET FOREIGN_KEY_CHECKS = 1; -SET SQL_SAFE_UPDATES = 1; - --- new_articles에서 old_id 컬럼 삭제 -ALTER TABLE `koin`.`new_articles` -DROP COLUMN old_id; diff --git a/src/main/resources/db/migration/V71__update_article_attachments_fk.sql b/src/main/resources/db/migration/V71__update_article_attachments_fk.sql deleted file mode 100644 index abb6103c4b..0000000000 --- a/src/main/resources/db/migration/V71__update_article_attachments_fk.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE `koin`.`article_attachments` -DROP FOREIGN KEY `article_attachments_ibfk_1`; -ALTER TABLE `koin`.`article_attachments` - ADD INDEX `FK_ARTICLE_ATTACHMENTS_ON_ARTICLE_ID_idx` (`article_id` ASC) VISIBLE, -DROP INDEX `ux_article_attachment`; diff --git a/src/main/resources/db/migration/V72__add_new_articles_fk.sql b/src/main/resources/db/migration/V72__add_new_articles_fk.sql deleted file mode 100644 index db4cf7b007..0000000000 --- a/src/main/resources/db/migration/V72__add_new_articles_fk.sql +++ /dev/null @@ -1,30 +0,0 @@ -ALTER TABLE `koin`.`new_articles` - ADD INDEX `FK_ARTICLES_ON_BOARD_ID_idx` (`board_id` ASC) VISIBLE; -; -ALTER TABLE `koin`.`new_articles` - ADD CONSTRAINT `FK_ARTICLES_ON_BOARD_ID` - FOREIGN KEY (`board_id`) - REFERENCES `koin`.`boards` (`id`) - ON DELETE NO ACTION - ON UPDATE NO ACTION; - - -ALTER TABLE `koin`.`new_koin_articles` - ADD INDEX `FK_KOIN_ARTICLES_ON_ARTICLE_ID_idx` (`article_id` ASC) VISIBLE; -; -ALTER TABLE `koin`.`new_koin_articles` - ADD CONSTRAINT `FK_KOIN_ARTICLES_ON_ARTICLE_ID` - FOREIGN KEY (`article_id`) - REFERENCES `koin`.`new_articles` (`id`) - ON DELETE NO ACTION - ON UPDATE NO ACTION; - -ALTER TABLE `koin`.`new_koreatech_articles` - ADD INDEX `FK_KOREATECH_ARTICLES_ON_ARTICLE_ID_idx` (`article_id` ASC) VISIBLE; -; -ALTER TABLE `koin`.`new_koreatech_articles` - ADD CONSTRAINT `FK_KOREATECH_ARTICLES_ON_ARTICLE_ID` - FOREIGN KEY (`article_id`) - REFERENCES `koin`.`new_articles` (`id`) - ON DELETE NO ACTION - ON UPDATE NO ACTION; diff --git a/src/main/resources/db/migration/V73__add_articles_table_fulltext_index.sql b/src/main/resources/db/migration/V73__add_articles_table_fulltext_index.sql deleted file mode 100644 index fd56c05b52..0000000000 --- a/src/main/resources/db/migration/V73__add_articles_table_fulltext_index.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE FULLTEXT INDEX idx_fulltext_title ON `koin`.`new_articles` (title) WITH PARSER ngram; diff --git a/src/main/resources/db/migration/V74__remove_article_user_id_of_deleted.sql b/src/main/resources/db/migration/V74__remove_article_user_id_of_deleted.sql deleted file mode 100644 index c8227efc79..0000000000 --- a/src/main/resources/db/migration/V74__remove_article_user_id_of_deleted.sql +++ /dev/null @@ -1,8 +0,0 @@ -SET SQL_SAFE_UPDATES = 0; - -UPDATE `koin`.`new_koin_articles` -SET user_id = NULL -WHERE user_id IN (SELECT id FROM `koin`.`users` WHERE is_deleted = 1) - OR user_id NOT IN (SELECT id FROM `koin`.`users`); - -SET SQL_SAFE_UPDATES = 1; diff --git a/src/main/resources/db/migration/V75__remove_deleted_koin_articles.sql b/src/main/resources/db/migration/V75__remove_deleted_koin_articles.sql deleted file mode 100644 index 5215f97a02..0000000000 --- a/src/main/resources/db/migration/V75__remove_deleted_koin_articles.sql +++ /dev/null @@ -1,8 +0,0 @@ -SET SQL_SAFE_UPDATES = 0; - -DELETE a, k -FROM `koin`.`new_articles` a - JOIN `koin`.`new_koin_articles` k ON a.id = k.article_id -WHERE k.is_deleted = 1; - -SET SQL_SAFE_UPDATES = 1; diff --git a/src/main/resources/db/migration/V76__add_coop_shop_semester_table.sql b/src/main/resources/db/migration/V76__add_coop_shop_semester_table.sql deleted file mode 100644 index 3a1644ff26..0000000000 --- a/src/main/resources/db/migration/V76__add_coop_shop_semester_table.sql +++ /dev/null @@ -1,26 +0,0 @@ -CREATE TABLE `coop_semester` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `semester` VARCHAR(200) NOT NULL UNIQUE, - `from_date` DATE NOT NULL, - `to_date` DATE NOT NULL, - `is_applied` TINYINT(1) NOT NULL DEFAULT '1', - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`) -); - -ALTER TABLE `coop_shop` - ADD COLUMN - `semester_id` INT UNSIGNED, - ADD CONSTRAINT `coop_semester_fk_id` FOREIGN KEY (`semester_id`) REFERENCES `coop_semester` (`id`) ON DELETE CASCADE, - DROP COLUMN `is_deleted`, - DROP COLUMN `semester`; - -ALTER TABLE `coop_opens` - DROP COLUMN `is_deleted`; - -ALTER TABLE `coop_opens` - CHANGE `coop_id` `coop_shop_id` INT UNSIGNED, - DROP CONSTRAINT `FK_COOP_ID`, - ADD CONSTRAINT `FK_COOP_SHOP_ID` FOREIGN KEY (`coop_shop_id`) REFERENCES `coop_shop` (`id`) ON DELETE CASCADE; diff --git a/src/main/resources/db/migration/V77__insert_coop_shop_semester.sql b/src/main/resources/db/migration/V77__insert_coop_shop_semester.sql deleted file mode 100644 index b4e61e4f58..0000000000 --- a/src/main/resources/db/migration/V77__insert_coop_shop_semester.sql +++ /dev/null @@ -1,50 +0,0 @@ -ALTER TABLE coop_semester AUTO_INCREMENT = 1; -ALTER TABLE coop_shop AUTO_INCREMENT = 2; -ALTER TABLE coop_opens AUTO_INCREMENT = 7; - -insert into `coop_semester` (`semester`, `from_date`, `to_date`, `is_applied`) -values ('24-2학기', '2024-09-02', '2024-12-20', 1); - -INSERT INTO `coop_shop` (`name`, `phone`, `location`, `remarks`, `semester_id`) -VALUES ('복지관식당', '041-560-1778', '복지관 2층', '능수관', 1), - ('대즐', '041-560-1779', '복지관 1층', '배달 서비스, 공·일요일 미운영', 1), - ('서점', '041-560-1756', '복지관 1층', '점심시간 12:00 - 13:00', 1), - ('세탁소', '041-552-1489', '학생회관 2층', NULL, 1), - ('복사실', '041-560-1093', '학생회관 2층', '점심시간 11:30 - 12:30', 1), - ('복지관 참빛관 편의점', '041-560-1093', '복지관 1층, 참빛관 1층', '복지관 임시운영 별도공지', 1), - ('미용실', '041-560-1769', '학생회관 1층', '예약제운영', 1), - ('오락실', '041-560-1472', '학생회관 1층', NULL, 1); - -SET @FIRST_ID = LAST_INSERT_ID(); - -INSERT INTO coop_opens (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) -VALUES (@FIRST_ID, '점심', 'WEEKDAYS', '11:40', '13:30'), - (@FIRST_ID, '점심', 'WEEKEND', '미운영', '미운영'), - (@FIRST_ID + 1, NULL, 'WEEKDAYS', '08:30', '21:00'), - (@FIRST_ID + 1, NULL, 'SATURDAY', '11:00', '18:00'), - (@FIRST_ID + 2, NULL, 'WEEKDAYS', '09:00', '18:00'), - (@FIRST_ID + 2, NULL, 'WEEKEND', '휴점', '휴점'), - (@FIRST_ID + 3, NULL, 'WEEKDAYS', '11:30', '18:00'), - (@FIRST_ID + 3, NULL, 'WEEKEND', '휴점', '휴점'), - (@FIRST_ID + 4, NULL, 'WEEKDAYS', '08:30', '18:00'), - (@FIRST_ID + 4, NULL, 'WEEKEND', '휴점', '휴점'), - (@FIRST_ID + 5, NULL, 'WEEKDAYS', '24시간', '24시간'), - (@FIRST_ID + 5, NULL, 'WEEKEND', '24시간', '24시간'), - (@FIRST_ID + 6, NULL, 'WEEKDAYS', '09:30', '17:00'), - (@FIRST_ID + 6, NULL, 'WEEKEND', '휴점', '휴점'), - (@FIRST_ID + 7, NULL, 'WEEKDAYS', '24시간', '24시간'), - (@FIRST_ID + 7, NULL, 'WEEKEND', '24시간', '24시간'); - -UPDATE coop_shop -SET semester_id = 1 -WHERE name = '학생식당'; - -UPDATE coop_opens -SET day_of_week = 'WEEKDAYS' -WHERE coop_shop_id = 1 - AND day_of_week = '평일'; - -UPDATE coop_opens -SET day_of_week = 'WEEKEND' -WHERE coop_shop_id = 1 - AND day_of_week = '주말'; diff --git a/src/main/resources/db/migration/V78__update_device_fk.sql b/src/main/resources/db/migration/V78__update_device_fk.sql deleted file mode 100644 index b4a3be95f5..0000000000 --- a/src/main/resources/db/migration/V78__update_device_fk.sql +++ /dev/null @@ -1,7 +0,0 @@ -ALTER TABLE device -DROP FOREIGN KEY FK_DEVICE_ON_USER_ID; - -ALTER TABLE device - ADD CONSTRAINT FK_DEVICE_ON_USER_ID - FOREIGN KEY (user_id) - REFERENCES users(id) ON DELETE CASCADE; diff --git a/src/main/resources/db/migration/V79__update_access_history_fk.sql b/src/main/resources/db/migration/V79__update_access_history_fk.sql deleted file mode 100644 index 79d5e9a492..0000000000 --- a/src/main/resources/db/migration/V79__update_access_history_fk.sql +++ /dev/null @@ -1,7 +0,0 @@ -ALTER TABLE access_history -DROP FOREIGN KEY FK_ACCESS_HISTORY_ON_DEVICE_ID; - -ALTER TABLE access_history - ADD CONSTRAINT FK_ACCESS_HISTORY_ON_DEVICE_ID - FOREIGN KEY (device_id) - REFERENCES device(id) ON DELETE SET NULL; diff --git a/src/main/resources/db/migration/V7__alter_diningmenus_change_field_type.sql b/src/main/resources/db/migration/V7__alter_diningmenus_change_field_type.sql deleted file mode 100644 index c67ba00bee..0000000000 --- a/src/main/resources/db/migration/V7__alter_diningmenus_change_field_type.sql +++ /dev/null @@ -1,11 +0,0 @@ -ALTER TABLE `dining_menus` - MODIFY COLUMN sold_out BOOLEAN NULL, - MODIFY COLUMN is_changed BOOLEAN NULL; - -UPDATE `dining_menus` -SET sold_out = NULL, - is_changed = NULL; - -ALTER TABLE `dining_menus` - MODIFY COLUMN sold_out DATETIME NULL, - MODIFY COLUMN is_changed DATETIME NULL; diff --git a/src/main/resources/db/migration/V80__delete_duplicate_article_attachments.sql b/src/main/resources/db/migration/V80__delete_duplicate_article_attachments.sql deleted file mode 100644 index 6bf5d6d05a..0000000000 --- a/src/main/resources/db/migration/V80__delete_duplicate_article_attachments.sql +++ /dev/null @@ -1,5 +0,0 @@ -DELETE a1 FROM article_attachments a1 -INNER JOIN article_attachments a2 -WHERE a1.id > a2.id - AND a1.article_id = a2.article_id - AND a1.hash = a2.hash; diff --git a/src/main/resources/db/migration/V81__update_article_attachments_uk.sql b/src/main/resources/db/migration/V81__update_article_attachments_uk.sql deleted file mode 100644 index 5736645c00..0000000000 --- a/src/main/resources/db/migration/V81__update_article_attachments_uk.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `koin`.`article_attachments` - ADD UNIQUE KEY ux_article_attachment (`article_id`, `hash`); diff --git a/src/main/resources/db/migration/V82__delete_shop_categories_isdeleted.sql b/src/main/resources/db/migration/V82__delete_shop_categories_isdeleted.sql deleted file mode 100644 index 8802fdbccd..0000000000 --- a/src/main/resources/db/migration/V82__delete_shop_categories_isdeleted.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE shop_categories DROP is_deleted; diff --git a/src/main/resources/db/migration/V83__insert_owner_version.sql b/src/main/resources/db/migration/V83__insert_owner_version.sql deleted file mode 100644 index 92d11d89ce..0000000000 --- a/src/main/resources/db/migration/V83__insert_owner_version.sql +++ /dev/null @@ -1,6 +0,0 @@ -INSERT INTO `versions` (`type`, `version`, `is_previous`, `title`, `content`) -VALUES ('android_owner', - '0.0.1', - 0, - '코인 사장님을 사용하기 위해\n업데이트가 꼭 필요해요.', - '코인 사장님 앱을 실행해 주셔서 감사합니다!\n앱을 사용하기 위해 아래 버튼을 눌러\n스토어에서 업데이트를 진행해 주세요.'); diff --git a/src/main/resources/db/migration/V84__update_admins_table.sql b/src/main/resources/db/migration/V84__update_admins_table.sql deleted file mode 100644 index 706d9a4cd7..0000000000 --- a/src/main/resources/db/migration/V84__update_admins_table.sql +++ /dev/null @@ -1,12 +0,0 @@ -DROP TABLE IF EXISTS `koin`.`admins`; - -CREATE TABLE `koin`.`admins` -( - `user_id` INT UNSIGNED NOT NULL COMMENT 'user 고유 id', - `team_type` VARCHAR(255) NOT NULL COMMENT '팀 타입', - `track_type` VARCHAR(255) NOT NULL COMMENT '트랙 타입', - `can_create_admin` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '어드민 계정 생성 권한', - `super_admin` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '슈퍼 어드민 권한', - PRIMARY KEY (`user_id`), - CONSTRAINT FK_ADMIN_ON_USER FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE -); diff --git a/src/main/resources/db/migration/V85__insert_admin_account_date.sql b/src/main/resources/db/migration/V85__insert_admin_account_date.sql deleted file mode 100644 index 49b550cd18..0000000000 --- a/src/main/resources/db/migration/V85__insert_admin_account_date.sql +++ /dev/null @@ -1,5 +0,0 @@ -INSERT INTO `koin`.`admins` (user_id, team_type, track_type, can_create_admin, super_admin) -SELECT u.id, 'KOIN', 'PL', 1, 1 -FROM `koin`.`users` u -WHERE u.user_type = 'ADMIN' -ORDER BY u.id ASC LIMIT 1; diff --git a/src/main/resources/db/migration/V86__add_admin_activity_history_table.sql b/src/main/resources/db/migration/V86__add_admin_activity_history_table.sql deleted file mode 100644 index 7fbefe54a1..0000000000 --- a/src/main/resources/db/migration/V86__add_admin_activity_history_table.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE `koin`.`admins_activity_history` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '고유 id', - `domain_id` INT UNSIGNED NULL COMMENT '도메인 엔티티 id', - `admin_id` INT UNSIGNED NOT NULL COMMENT '어드민 고유 id', - `request_method` VARCHAR(10) NOT NULL COMMENT 'HTTP 요청 메소드', - `domain_name` VARCHAR(20) NOT NULL COMMENT '도메인 이름', - `request_message` TEXT NULL COMMENT 'HTTP 요청 메시지 바디', - `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 일자', - `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '업데이트 일자', - PRIMARY KEY (id), - CONSTRAINT `FK_HISTORY_ON_ADMIN` FOREIGN KEY (`admin_id`) REFERENCES `admins` (`user_id`) ON DELETE CASCADE -) diff --git a/src/main/resources/db/migration/V87__add_shop_notification_messages_and_insert_data.sql b/src/main/resources/db/migration/V87__add_shop_notification_messages_and_insert_data.sql deleted file mode 100644 index 9f2e5fc01f..0000000000 --- a/src/main/resources/db/migration/V87__add_shop_notification_messages_and_insert_data.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE `shop_notification_messages` -( - id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY COMMENT 'shop_notification_messages 고유 id', - title VARCHAR(255) NOT NULL COMMENT '메세지 제목', - content VARCHAR(255) NOT NULL COMMENT '메세지 내용', - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT '생성 일자', - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자' -); - -INSERT INTO `shop_notification_messages` (title, content) -VALUES (', 맛있게 드셨나요?', '드신 메뉴에 대한 리뷰를 작성해보세요!'), - (', 편안하게 이동하셨나요?', '승차하신 콜벤에 대한 리뷰를 작성해보세요!'), - (', 어떠셨나요?', '이용하신 샵에 대한 리뷰를 작성해보세요!'); diff --git a/src/main/resources/db/migration/V88__add_shop_main_categories_table_and_insert_data.sql b/src/main/resources/db/migration/V88__add_shop_main_categories_table_and_insert_data.sql deleted file mode 100644 index 878f8c369c..0000000000 --- a/src/main/resources/db/migration/V88__add_shop_main_categories_table_and_insert_data.sql +++ /dev/null @@ -1,15 +0,0 @@ -CREATE TABLE `shop_main_categories` -( - id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY COMMENT 'shop_main_categories 고유 id', - name VARCHAR(255) NOT NULL COMMENT '메인 카테고리 이름', - notification_message_id INT UNSIGNED NOT NULL COMMENT '알림 메시지 id', - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT '생성 일자', - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 일자', - CONSTRAINT `FK_MAIN_CATEGORIES_ON_SHOP_NOTIFICATION_MESSAGES` - FOREIGN KEY (`notification_message_id`) REFERENCES `shop_notification_messages` (`id`) -); - -INSERT INTO `shop_main_categories` (name, notification_message_id) -VALUES ('가게', 1), - ('콜벤', 2), - ('뷰티', 3); diff --git a/src/main/resources/db/migration/V89__alter_shop_categories_add_main_category_id_column.sql b/src/main/resources/db/migration/V89__alter_shop_categories_add_main_category_id_column.sql deleted file mode 100644 index d511b7b600..0000000000 --- a/src/main/resources/db/migration/V89__alter_shop_categories_add_main_category_id_column.sql +++ /dev/null @@ -1,14 +0,0 @@ -ALTER TABLE `shop_categories` - ADD COLUMN `main_category_id` INT UNSIGNED COMMENT '메인 카테고리 id', - ADD CONSTRAINT `FK_SHOP_CATEGORIES_ON_SHOP_MAIN_CATEGORIES` - FOREIGN KEY (`main_category_id`) - REFERENCES `shop_main_categories` (`id`); - -UPDATE shop_categories -SET main_category_id = - CASE - WHEN name IN ('기타/콜밴', '콜벤') THEN 2 - WHEN name IN ('기타', '뷰티') THEN 3 - ELSE 1 - END -WHERE id != 1; \ No newline at end of file diff --git a/src/main/resources/db/migration/V8__alter_notificaion_change_column_name.sql b/src/main/resources/db/migration/V8__alter_notificaion_change_column_name.sql deleted file mode 100644 index 8fc960d7c1..0000000000 --- a/src/main/resources/db/migration/V8__alter_notificaion_change_column_name.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `notification` - CHANGE COLUMN url app_path VARCHAR(255); diff --git a/src/main/resources/db/migration/V90__add_shop_notification_queue.sql b/src/main/resources/db/migration/V90__add_shop_notification_queue.sql deleted file mode 100644 index 47959db158..0000000000 --- a/src/main/resources/db/migration/V90__add_shop_notification_queue.sql +++ /dev/null @@ -1,11 +0,0 @@ -CREATE TABLE `shop_notification_buffer` -( - id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY COMMENT 'shop_notification_buffer 고유 id', - shop_id INT UNSIGNED NOT NULL COMMENT '상점 ID', - user_id INT UNSIGNED NOT NULL COMMENT '사용자 ID', - notification_time TIMESTAMP NOT NULL COMMENT '알림 시간', - CONSTRAINT `FK_SHOP_NOTIFICATION_BUFFER_ON_SHOPS` - FOREIGN KEY (`shop_id`) REFERENCES `shops` (`id`), - CONSTRAINT `FK_SHOP_NOTIFICATION_BUFFER_ON_USERS` - FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) -); diff --git a/src/main/resources/db/migration/V91__insert_notification_subscribe_review_prompt.sql b/src/main/resources/db/migration/V91__insert_notification_subscribe_review_prompt.sql deleted file mode 100644 index f0e14f27ab..0000000000 --- a/src/main/resources/db/migration/V91__insert_notification_subscribe_review_prompt.sql +++ /dev/null @@ -1,4 +0,0 @@ -INSERT INTO notification_subscribe (created_at, updated_at, subscribe_type, user_id) -SELECT NOW(), NOW(), 'REVIEW_PROMPT', s.user_id -FROM students s - JOIN users u ON s.user_id = u.id; diff --git a/src/main/resources/db/migration/V92__delete_notification_subscribe_review_prompt.sql b/src/main/resources/db/migration/V92__delete_notification_subscribe_review_prompt.sql deleted file mode 100644 index 9175d1fcd5..0000000000 --- a/src/main/resources/db/migration/V92__delete_notification_subscribe_review_prompt.sql +++ /dev/null @@ -1,8 +0,0 @@ -DELETE FROM notification_subscribe -WHERE subscribe_type = 'REVIEW_PROMPT'; - -INSERT INTO notification_subscribe (created_at, updated_at, subscribe_type, user_id) -SELECT NOW(), NOW(), 'REVIEW_PROMPT', s.user_id -FROM students s - JOIN users u ON s.user_id = u.id -WHERE u.device_token IS NOT NULL; diff --git a/src/main/resources/db/migration/V93__alter_shop_main_categories_table_name.sql b/src/main/resources/db/migration/V93__alter_shop_main_categories_table_name.sql deleted file mode 100644 index 2c34d3625a..0000000000 --- a/src/main/resources/db/migration/V93__alter_shop_main_categories_table_name.sql +++ /dev/null @@ -1,15 +0,0 @@ -RENAME TABLE `shop_main_categories` TO `shop_parent_categories`; - -ALTER TABLE `shop_categories` - CHANGE `main_category_id` `parent_category_id` INT UNSIGNED COMMENT '상위 카테고리 id'; - -ALTER TABLE `shop_categories` -DROP FOREIGN KEY `FK_SHOP_CATEGORIES_ON_SHOP_MAIN_CATEGORIES`; - -ALTER TABLE `shop_categories` - ADD CONSTRAINT `FK_SHOP_CATEGORIES_ON_SHOP_PARENT_CATEGORIES` - FOREIGN KEY (`parent_category_id`) - REFERENCES `shop_parent_categories` (`id`); - -ALTER TABLE `shop_parent_categories` - MODIFY `id` INT UNSIGNED AUTO_INCREMENT COMMENT 'shop_parent_categories 고유 id'; diff --git a/src/main/resources/db/migration/V94__add_menu_search_keyword_table.sql b/src/main/resources/db/migration/V94__add_menu_search_keyword_table.sql deleted file mode 100644 index 058eb56071..0000000000 --- a/src/main/resources/db/migration/V94__add_menu_search_keyword_table.sql +++ /dev/null @@ -1,8 +0,0 @@ -CREATE TABLE if not exists `shop_menu_search_keywords` -( - id INT UNSIGNED AUTO_INCREMENT NOT NULL, - keyword VARCHAR(255) NOT NULL, - created_at timestamp default CURRENT_TIMESTAMP NOT NULL, - updated_at timestamp default CURRENT_TIMESTAMP NOT NULL on update CURRENT_TIMESTAMP, - PRIMARY KEY (`id`) - ); diff --git a/src/main/resources/db/migration/V95__insert_initial_menu_keywords.sql b/src/main/resources/db/migration/V95__insert_initial_menu_keywords.sql deleted file mode 100644 index 46b568b2ba..0000000000 --- a/src/main/resources/db/migration/V95__insert_initial_menu_keywords.sql +++ /dev/null @@ -1,1174 +0,0 @@ -INSERT INTO shop_menu_search_keywords (keyword) -VALUES ('흑마늘족발'), - ('허니마늘족발'), - ('바베큐마늘족발'), - ('직화불족발'), - ('보쌈'), - ('가족의족보'), - ('반반족발'), - ('쟁반국수'), - ('냉채족발'), - ('얼큰술국'), - ('보불셋트'), - ('오리엔탈마늘샐러드'), - ('가마보꼬모듬오뎅탕'), - ('떡볶이'), - ('모둠튀김'), - ('순대'), - ('어묵'), - ('볶음밥'), - ('돈까스'), - ('감성떡볶이'), - ('치즈떡볶이'), - ('매운크림떡볶이'), - ('감성김밥'), - ('참치김밥'), - ('새우튀김김밥'), - ('김치돈까스김밥'), - ('참치마요컵밥'), - ('스팸김치컵밥'), - ('감성돈까스'), - ('치즈돈까스'), - ('새우튀김'), - ('오징어튀김'), - ('고구마튀김'), - ('김말이'), - ('치즈스틱'), - ('치즈볼'), - ('어묵튀김'), - ('목살볶음밥'), - ('김치목살볶음밥'), - ('새우볶음밥'), - ('불닭볶음밥'), - ('콜라/사이다'), - ('쿨피스'), - ('뼈해장국'), - ('닭볶음탕'), - ('고추장불고기'), - ('닭갈비'), - ('김치찌개'), - ('간장불고기'), - ('알탕'), - ('알밥'), - ('순두부찌개'), - ('낙지볶음덮밥'), - ('원조김밥'), - ('계란말이김밥'), - ('김치김밥'), - ('치즈김밥'), - ('소고기김밥'), - ('매운참치김밥'), - ('오뎅'), - ('김치만두'), - ('고기만두'), - ('군만두'), - ('물만두'), - ('갈비만두'), - ('매콤만두'), - ('새우만두'), - ('김말이튀김'), - ('우동'), - ('라면'), - ('계란라면'), - ('떡라면'), - ('김치라면'), - ('치즈라면'), - ('만두라면'), - ('짬뽕라면'), - ('짬뽕우동'), - ('라볶이'), - ('치즈라볶이'), - ('모듬떡볶이'), - ('모듬라볶이'), - ('잔치국수'), - ('수제비'), - ('얼큰수제비'), - ('항아리수제비'), - ('항아리칼국수'), - ('항아리칼제비'), - ('칼국수'), - ('얼큰칼국수'), - ('쫄면'), - ('떡만두국'), - ('만두국'), - ('떡국'), - ('비빔밥'), - ('참치비빔밥'), - ('양푼비빔밥'), - ('돌솥비빔밥'), - ('치즈돌솥비빔밥'), - ('김치알밥'), - ('치즈김치알밥'), - ('육개장'), - ('내장탕'), - ('갈비탕'), - ('올갱이해장국'), - ('스페셜정식'), - ('철판햄버그스테이크'), - ('고구마돈까스'), - ('매운돈까스'), - ('생선까스'), - ('김치덮밥'), - ('오징어덮밥'), - ('제육덮밥'), - ('참치덮밥'), - ('뚝배기불고기'), - ('철판낙지볶음'), - ('철판오삼불고기'), - ('꽁치김치조림'), - ('참치김치찌개'), - ('된장찌개'), - ('부대찌개'), - ('치즈부대찌개'), - ('고등어김치조림'), - ('오므라이스'), - ('치즈오므라이스'), - ('카레라이스'), - ('물냉면'), - ('비빔냉면'), - ('막국수'), - ('비빔막국수'), - ('열무국수'), - ('열무냉면'), - ('순살돈까스'), - ('토마토스파게티'), - ('크림스파게티'), - ('맞춤도시락'), - ('즉석떡볶이'), - ('병맥주'), - ('소주'), - ('음료수'), - ('후라이드'), - ('새우버거'), - ('치킨버거'), - ('불고기버거'), - ('양념치킨'), - ('간장치킨'), - ('스노윙치즈'), - ('핫블링'), - ('크리미언'), - ('소이갈릭'), - ('쇼킹핫'), - ('매콤치즈스노윙'), - ('포테이토짜용치킨'), - ('허니갈릭'), - ('오리엔탈파닭'), - ('파닭발'), - ('순살치킨'), - ('닭다리'), - ('닭날개/윙봉'), - ('스노윙치킨'), - ('마늘치킨'), - ('후닭'), - ('핫후닭'), - ('네네볼'), - ('네네스위틱'), - ('감자튀김'), - ('짜용소스'), - ('뚝배기뼈해장국'), - ('김치짜글이'), - ('노걸대왕갈비탕'), - ('콩나물해장국'), - ('황태해장국'), - ('얼큰이내장탕'), - ('막걸리'), - ('맥주'), - ('복분자'), - ('청하'), - ('삼겹살'), - ('막창'), - ('순살간장조림닭볶음'), - ('순살매콤닭볶음'), - ('순살된장닭볶음'), - ('순살닭도리탕'), - ('닭똥집볶음'), - ('닭치찌개'), - ('음료수 큰거'), - ('공기밥'), - ('해물칼국수'), - ('버섯육개장'), - ('찐만두'), - ('콩국수'), - ('냉면'), - ('손짜장'), - ('간짜장'), - ('손우동'), - ('손짬뽕'), - ('불짬뽕'), - ('굴짬뽕'), - ('대왕성특면'), - ('낙지짬뽕'), - ('해물삼선짬뽕'), - ('해물쟁반짜장'), - ('해물쟁반짬뽕'), - ('해물삼선간짜장'), - ('짜장밥'), - ('짬뽕밥'), - ('잡채밥'), - ('삼선볶음밥'), - ('계살볶음밥'), - ('대왕성특밥'), - ('송이덮밥'), - ('잡탕밥'), - ('유산슬밥'), - ('탕수육'), - ('사천탕수육'), - ('고기잡채'), - ('양장피'), - ('난자완스'), - ('깐풍육'), - ('깐풍기'), - ('깐쇼새우'), - ('유산슬'), - ('짬짜면'), - ('볶짜면'), - ('볶짬면'), - ('탕짜면'), - ('탕짬면'), - ('탕볶밥'), - ('물막국수'), - ('이탤리노치즈피자'), - ('콤비네이션피자'), - ('양송이피자'), - ('불고기피자'), - ('웨지감자피자'), - ('웨지고구마피자'), - ('베이컨피자'), - ('베이컨포테이토피자'), - ('오로너비아니피자'), - ('핫소스'), - ('갈릭소스'), - ('피클'), - ('치즈크러스트 엣지'), - ('콜라'), - ('사이다'), - ('치즈치킨'), - ('칠리양념'), - ('마늘간장'), - ('카레양념'), - ('치킨무'), - ('파닭'), - ('속초명가닭강정'), - ('탕수육치킨'), - ('악마치킨'), - ('디디한마리'), - ('빅디디'), - ('후라이드윙'), - ('닭다리후라이드'), - ('핫후라이드'), - ('디디콤보'), - ('리치디디'), - ('치만이순살세트'), - ('치만이세트'), - ('고추장찌개'), - ('콩구수'), - ('김치볶음밥'), - ('피자치탕'), - ('감자피자치탕'), - ('고구마피자치탕'), - ('김치피자치탕'), - ('만두피자치탕'), - ('데리야키치탕'), - ('딥치즈싸이버거'), - ('싸이버거'), - ('언블리버블버거'), - ('쉬림프싸이플렉스버거'), - ('불싸이버거'), - ('화이트갈릭버거'), - ('싸이플렉스버거'), - ('간장마늘싸이버거'), - ('딥치즈버거'), - ('양념치킨싸이버거'), - ('휠렛버거'), - ('인크레더블버거'), - ('등심탕수육'), - ('치킨탕수육'), - ('오뎅탕'), - ('누룽지'), - ('계란찜'), - ('김가루밥'), - ('몽룡이네 닭볶음탕'), - ('몽룡이네 닭찜'), - ('짜장'), - ('짬뽕'), - ('쟁반짜장'), - ('짜장면'), - ('삼선간짜장'), - ('삼선우동'), - ('삼선짬뽕'), - ('차돌짬뽕'), - ('쟁반짬뽕'), - ('삼선짬뽕밥'), - ('아구찜'), - ('돌문어찜'), - ('돌문어볶음'), - ('오리주물럭'), - ('찜닭'), - ('곱창전골'), - ('매운돼지갈비찜'), - ('닭도리탕'), - ('오삼불고기'), - ('낙지볶음'), - ('골뱅이무침'), - ('동태탕'), - ('돼지짜글이'), - ('제육볶음'), - ('오징어볶음'), - ('쭈꾸미볶음'), - ('똥집볶음'), - ('닭발'), - ('뼈없는닭발'), - ('고갈비'), - ('두부김치'), - ('해물김치전'), - ('계란말이'), - ('설렁탕'), - ('사골우거지탕'), - ('사골만두국'), - ('수제돈까스'), - ('청국장찌개'), - ('낙지순두부찌개'), - ('오징어찌개'), - ('참치찌개'), - ('양념주먹밥'), - ('황금올리브치킨'), - ('반반치킨'), - ('간장닭날개'), - ('빠리치킨'), - ('양파닭'), - ('마라핫치킨'), - ('소이갈릭치킨'), - ('허니갈릭스치킨'), - ('치즐링'), - ('자메이카통자리구이'), - ('스모크치킨'), - ('이스탄불'), - ('순살크래커'), - ('순살소이갈릭스'), - ('순살빠리치킨'), - ('순살후라이드'), - ('순살마라핫'), - ('순살치즐링'), - ('순살양념'), - ('순살파닭'), - ('골뱅이 무침'), - ('생맥주'), - ('꽃게탕'), - ('해물탕'), - ('매운뼈없는닭발'), - ('똥집야채볶음'), - ('매운똥집야채볶음'), - ('고추장감자찌개'), - ('동태찌개'), - ('병천순대'), - ('농어'), - ('도미'), - ('우럭'), - ('광어'), - ('놀래미'), - ('홍탁'), - ('능성어'), - ('감성돔'), - ('돗돔'), - ('돌돔'), - ('도다리'), - ('통우럭매운탕'), - ('생선초밥'), - ('방어'), - ('숭어'), - ('전복'), - ('멍게'), - ('개불'), - ('봉구스밥버거'), - ('햄밥버거'), - ('치즈밥버거'), - ('햄치즈밥버거'), - ('김치떡갈비밥버거'), - ('마요떡갈비밥버거'), - ('치즈떡갈비밥버거'), - ('제육밥버거'), - ('김치제육밥버거'), - ('치즈제육밥버거'), - ('카레밥버거'), - ('짜장밥버거'), - ('치즈불닭'), - ('불닭'), - ('불날개'), - ('불닭발'), - ('뼈없는불닭발'), - ('불족발'), - ('불똥집'), - ('불오돌뼈'), - ('야채똥집'), - ('훈제치킨'), - ('주먹밥'), - ('치즈추가'), - ('생왕소금구이'), - ('수입삼겹살'), - ('소갈비살'), - ('생삼겹살'), - ('항정살'), - ('불돈모듬'), - ('생돈모듬'), - ('돼지막창'), - ('돼지껍데기'), - ('오리지날순살'), - ('오리지날 후라이드'), - ('양념'), - ('간장'), - ('매운양념'), - ('크리스피 순살'), - ('모듬튀김'), - ('떡튀김'), - ('도시락세트'), - ('조개칼국수'), - ('얼큰이칼국수'), - ('오리육개장'), - ('미린다'), - ('자장면'), - ('울면'), - ('사천짜장'), - ('유니짜장'), - ('삼선울면'), - ('기스면'), - ('마파두부밥'), - ('고추덮밥'), - ('해삼탕밥'), - ('잡채'), - ('마파두부'), - ('덴뿌라'), - ('팔보채'), - ('잡탕'), - ('고추잡채'), - ('라조기'), - ('라조육'), - ('깐풍새우'), - ('해삼탕'), - ('파고추장삼겹'), - ('소갈비살비빔밥'), - ('소불고기덮밥'), - ('라면사리'), - ('속초원조닭강정'), - ('매운강정'), - ('마늘간장강정'), - ('스위트칠리강정'), - ('까르보나라'), - ('통닭발'), - ('무뼈닭발'), - ('국물떡볶이'), - ('쏘야밥버거'), - ('바삭멸치밥버거'), - ('진미채밥버거'), - ('소불고기밥버거'), - ('김치불고기밥버거'), - ('청양불고기밥버거'), - ('통살돈까스밥버거'), - ('통살돈까스마요밥버거'), - ('칠리치킨밥버거'), - ('치킨마요밥버거'), - ('버터장조림밥버거'), - ('오징어밥버거'), - ('전주비빔밥버거'), - ('추억의도시락밥버거'), - ('고추장삼겹살'), - ('들깨수제비'), - ('해물파전'), - ('감자탕전골'), - ('붉닭발'), - ('뼈없는 불닭발'), - ('국물닭발'), - ('치즈피자'), - ('고구마피자'), - ('통새우피자'), - ('핫치킨새우피자'), - ('불갈비피자'), - ('페파로니피자'), - ('토핑족발'), - ('슈퍼콤비네이션'), - ('토핑보쌈'), - ('핫치킨피자'), - ('포테이토베이컨피자'), - ('불고기새우피자'), - ('감자새우피자'), - ('왕족발'), - ('치즈바이트피자'), - ('야채피자'), - ('포테이토피자'), - ('파인애플피자'), - ('고구마감자피자'), - ('게맛살골드피자'), - ('왕보쌈'), - ('왕족막국수'), - ('해파리냉채'), - ('사골떡만두국'), - ('우거지뼈다귀탕'), - ('사골곰탕'), - ('뼈다귀전골'), - ('육개장전골'), - ('육계닭도리탕'), - ('토종닭도리탕'), - ('묵은지수육찜'), - ('육계장'), - ('소고기덮밥'), - ('왕돈까스'), - ('모듬김밥'), - ('기본김밥'), - ('제육도시락'), - ('숯불고기도시락'), - ('우삼겹도시락'), - ('마스도시락'), - ('왕천파닭'), - ('삼겹살도시락'), - ('순살간장'), - ('특삼겹살도시락'), - ('순살반반'), - ('순살매운양념'), - ('쥬피터도시락'), - ('똥집튀김'), - ('돼지김치찌개'), - ('똥집양념'), - ('똥집간장'), - ('미니김치찜'), - ('똥집반반'), - ('우삼겹된장찌개'), - ('닭떡볶이'), - ('우삼겹떡볶이'), - ('규동'), - ('우삼겹숙주덮밥'), - ('우삼겹볶음밥'), - ('족발'), - ('참기름계란밥'), - ('스팸컵밥'), - ('미니족'), - ('불족'), - ('제육컵밥'), - ('샐러드비빔밥'), - ('붉닭샐비'), - ('안심탕수육'), - ('아나고'), - ('탄산음료'), - ('특전복죽'), - ('해삼'), - ('전복죽'), - ('오징어'), - ('낙지'), - ('게불'), - ('장조림'), - ('자연송이죽'), - ('자연송이전복죽'), - ('전복인삼닭죽'), - ('매생이굴죽'), - ('바다치즈죽'), - ('순한불낙죽'), - ('매콤불낙죽'), - ('브로콜리새우죽'), - ('커리치킨죽'), - ('버섯굴죽'), - ('인삼닭죽'), - ('모듬해물죽'), - ('한우야채죽'), - ('버섯들깨죽'), - ('낙지김치죽'), - ('참치야채죽'), - ('버섯야채죽'), - ('얼큰김치죽'), - ('황태콩나물죽'), - ('홍합미역죽'), - ('야채죽'), - ('치킨데리야끼볶음밥'), - ('불낙지볶음밥'), - ('해물볶음밥'), - ('햄야채볶음밥'), - ('불고기볶음밥'), - ('흑임자죽'), - ('녹두죽'), - ('호박죽'), - ('마죽'), - ('팥죽'), - ('흰죽'), - ('주니어불고기버거'), - ('화이트짬봉'), - ('애니버거'), - ('삼선고추짱뽕'), - ('애니불고기버거'), - ('미친짬뽕'), - ('속풀이짬뽕'), - ('에그불고기버거'), - ('얼큰이짬뽕'), - ('누룽지탕'), - ('애니치즈버거'), - ('핫치킨버거'), - ('황제짬뽕'), - ('왕만두'), - ('떡갈비버거'), - ('수제돈가스버거'), - ('수제 치즈돈가스버거'), - ('수제 피자돈가스버거'), - ('수제핫버거'), - ('핫도그소세지 버거'), - ('칠리소세지 버거'), - ('치즈소세지 버거'), - ('순살강정'), - ('치킨너겟'), - ('아메리카노'), - ('카푸치노'), - ('카페라떼'), - ('우유'), - ('복숭아 아이스티'), - ('블루베리 아이스티'), - ('레몬 에이드'), - ('딸기쥬스'), - ('망고쥬스'), - ('오렌지 쥬스'), - ('키위쥬스'), - ('블루베리 쥬스'), - ('후라이드치킨'), - ('올리고당양념'), - ('순살치폴레양념'), - ('순살양념치킨'), - ('매운불양념치킨'), - ('치폴레양념치킨'), - ('순살매운불양념'), - ('치즈슈프림양념'), - ('순살치즈슈프림양념'), - ('새치 고기고기'), - ('돈치 고기고기'), - ('동백'), - ('돈까스도련님'), - ('치킨제육'), - ('간장한마리치킨'), - ('간장다리치킨'), - ('간장날개치킨'), - ('강정치킨'), - ('순살 양념'), - ('순살/다리/날개'), - ('레몬파닭'), - ('순살레몬파닭'), - ('닭강정'), - ('청국장'), - ('우렁쌈밥정식'), - ('제육정식'), - ('산채나물밥'), - ('민물새우탕'), - ('황태찜'), - ('오골계백숙'), - ('한마리반치킨'), - ('크리스피'), - ('다리치킨'), - ('날개치킨'), - ('카레치킨'), - ('케이준감자튀김'), - ('크림어니언치킨'), - ('청고추드레싱치킨'), - ('까르보나라치킨'), - ('낙곱새'), - ('낙삼새'), - ('떡사리'), - ('오뎅사리'), - ('우동사리'), - ('계란'), - ('참치주먹밥'), - ('비엔나'), - ('치즈떡'), - ('바닐라라떼'), - ('헤이즐넛라떼'), - ('캐러멜마끼아또'), - ('카페모카'), - ('더치커피'), - ('샷추가'), - ('아이스티'), - ('자몽쥬스'), - ('유자깔라만시'), - ('핫초코'), - ('녹차'), - ('홍차'), - ('민트초코라떼'), - ('고구마라떼'), - ('블루베리라떼'), - ('딸기스무디'), - ('키위스무디'), - ('망고피치스무디'), - ('Freddo 조리퐁퐁'), - ('Freddo 블루베리'), - ('쿠키앤크림'), - ('쿠키'), - ('블루베리스콘'), - ('베이글'), - ('크림치즈프렛즐'), - ('케이크'), - ('샌드위치'), - ('옛날통치킨'), - ('소스'), - ('알싸한마늘간장치킨'), - ('고추마늘간장'), - ('치즈스노우퀸'), - ('꿀간장치킨'), - ('마늘빵치킨'), - ('따뜻한족발'), - ('매운족발'), - ('달콤한 탕수육'), - ('족발덮밥'), - ('불닭곱창'), - ('맛초킹'), - ('해바라기후라이드'), - ('뿌링클'), - ('커리퀸'), - ('매운양념치킨'), - ('맵삭치킨'), - ('치즈뿌리오'), - ('페퍼로니피자'), - ('이탈리안치즈피자'), - ('투어고구마피자'), - ('투어콤비네이션피자'), - ('슈퍼콤비네이션피자'), - ('프리미엄수제불고기피자'), - ('통고구마피자'), - ('스페셜고구마샐러드피자'), - ('숯불갈비피자'), - ('칠리핫치킨피자'), - ('스페셜단호박샐러드피자'), - ('스페셜피자'), - ('수블라키피자'), - ('폭립베이컨피자'), - ('스페셜쉬림프골드피자'), - ('숯불갈비바이트피자'), - ('스페셜바이트피자'), - ('베이컨포테이토바이트피자'), - ('폭립베이컨바이트피자'), - ('구운치킨'), - ('치즈스파게티'), - ('감자스낵'), - ('돈까스카레'), - ('새우돈까스덮밥'), - ('돈까스덮밥'), - ('소불고기철판볶음밥'), - ('스팸철판볶음밥'), - ('김치 부대찌개'), - ('묵은지김치찌개'), - ('빅치킨마요'), - ('돈치마요'), - ('치킨마요'), - ('참치마요'), - ('튼튼도시락'), - ('케이준후라이'), - ('오리지널 닭강정'), - ('참치야채 감초고추장'), - ('소불고기 감초고추장 비빔밥'), - ('시골제육 두부강된장 비빔밥'), - ('두부강된장소스'), - ('왕카레돈까스덮밥'), - ('왕치킨마요'), - ('튀김류'), - ('중국당면'), - ('대창'), - ('새우'), - ('탕수육도련님'), - ('칠리 찹쌀탕수육'), - ('미니 찹쌀탕수육'), - ('뉴 감자고로케'), - ('토네이도 소세지'), - ('치킨'), - ('메가 치킨마요'), - ('메가 치킨제육'), - ('김말이피치탕'), - ('닭백숙'), - ('에스프레소'), - ('카라멜마끼야또'), - ('민트카페모카'), - ('아인슈페너'), - ('그린티라떼'), - ('초코라떼'), - ('자색고구마라떼'), - ('밀크티라떼'), - ('흑당라떼'), - ('흑당밀크티'), - ('얼그레이'), - ('잉글리쉬 블랙퍼스트'), - ('허브티'), - ('프룻티'), - ('바나나'), - ('딸바'), - ('딸기'), - ('망고스무디'), - ('블루베리스무디'), - ('플레인요거트'), - ('딸기요거트'), - ('유자요거트'), - ('블루베리요거트'), - ('망고요거트'), - ('새우데리야끼'), - ('해물매콤토마토'), - ('프렌치토스트'), - ('가든샐러드'), - ('치킨샐러드'), - ('허니브레드'), - ('레몬에이드'), - ('자몽에이드'), - ('블루베리에이드'), - ('청포도에이드'), - ('블루레몬에이드'), - ('체리에이드'), - ('유자에이드'), - ('패션후르츠에이드'), - ('나폴리피자'), - ('스테이크피자'), - ('까르보네피자'), - ('아이리쉬포테이토피자'), - ('고르곤졸라피자'), - ('더블갈릭바베큐피자'), - ('깐쇼새우피자'), - ('직화파인애플피자'), - ('닭안심살피자'), - ('퀘사디아피자'), - ('직화홀릭바이트피자'), - ('도이치바이트피자'), - ('멕시칸바이트피자'), - ('미트러버피자'), - ('킹소시지피자'), - ('치킨스틱'), - ('치킨텐더'), - ('새우링'), - ('웨지감자'), - ('치즈오븐스파게티'), - ('갈릭포테이토'), - ('야채곱창'), - ('오돌뼈'), - ('떡 추가'), - ('햇반'), - ('순대국밥'), - ('고기국밥'), - ('곱창볶음'), - ('크림순대볶음'), - ('허니고르곤피자'), - ('육해공골드피자'), - ('불새피자'), - ('바이트골드피자'), - ('농촌피자'), - ('어촌피자'), - ('왕창포테이토피자'), - ('고기농장피자'), - ('스위트골드피자'), - ('단호박피자'), - ('치즈그라인스파게티'), - ('윙봉'), - ('불고기스파게티'), - ('오굿박스'), - ('고구마무스'), - ('치즈크러스트'), - ('고구마크러스트'), - ('체다엣지'), - ('골드엣지'), - ('바이트골드'), - ('흑미도우'), - ('간장바베큐'), - ('고추장바베큐'), - ('매콤후라이드'), - ('깐풍치킨'), - ('웰빙파닭'), - ('앙념치킨'), - ('순살3종세트'), - ('똥집후라이드'), - ('깐풍똥집'), - ('모듬감자튀김'), - ('눈꽃치즈떡볶이'), - ('파절이'), - ('배달소주'), - ('옛날통닭'), - ('쟁반막국수'), - ('무김치'), - ('야채'), - ('닭똥집'), - ('마늘간장치킨'), - ('매운간장치킨'), - ('뼈있는파닭'), - ('순살간장치킨'), - ('순살마늘간장치킨'), - ('순살매운간장'), - ('돼지갈비'), - ('가브리살'), - ('돼지모듬'), - ('목살'), - ('한우버섯죽'), - ('한우미역죽'), - ('삼선짬뽕죽'), - ('모듬해물된장죽'), - ('새우미역죽'), - ('게살날치알죽'), - ('삼계탕'), - ('잣죽'), - ('음료'), - ('철판김치볶음밥'), - ('치즈철판김치볶음밥'), - ('갈치무우조림'), - ('교촌 소이 살살'), - ('교촌 후라이드'), - ('교촌 샐러드'), - ('교촌 웨지 감자'), - ('고량주'), - ('이과두주'), - ('연태고량주'), - ('오리지널 감자'), - ('양념 감자'), - ('통오징어 튀김'), - ('크림 생맥주'), - ('레드락'), - ('진저하이볼'), - ('참이슬'), - ('사과맥주'), - ('포도맥주'), - ('레몬맥주'), - ('딸기맥주'), - ('자몽맥주'), - ('청사과맥주'), - ('더치맥주'), - ('꿀맥주'), - ('망고맥주'), - ('바닐라맥주'), - ('수박맥주'), - ('청포도맥주'), - ('호가든'), - ('코젤'), - ('갈릭칠리 소스'), - ('갈릭치즈 소스'), - ('어니언 소스'), - ('갈릭 소스'), - ('스위트칠리 소스'), - ('사워크림 소스'), - ('허니머스타드 소스'), - ('케찹'), - ('핫칠리 소스'), - ('핫비비큐 소스'), - ('나쵸치즈 소스'), - ('슈퍼슈프림피자'), - ('군고구마피자'), - ('버팔로윙'), - ('해물뼈전골'), - ('해물뼈찜'), - ('뼈다귀해장국'), - ('얼큰이 갈비탕'), - ('우거지탕'), - ('뚝불고기'), - ('해물알탕'), - ('소곱창전골'), - ('뚝불'), - ('햄볶음밥'), - ('비빔만두'), - ('어묵탕'), - ('치킨까스'), - ('냠냠김밥'), - ('냠냠라면'), - ('골뱅이소면'), - ('비빔국수'), - ('물국수'), - ('돈가스'), - ('치즈돈가스'), - ('매운치즈돈가스'), - ('단호박치즈돈가스'), - ('콩나물불고기'), - ('가쓰오탕수육'), - ('허니골드탕수육'), - ('불피자탕수육'), - ('피자탕수육'), - ('눈꽃탕수육'), - ('김치피자탕수육'), - ('쩐더탕수육'), - ('양념탕수육'), - ('간장탕수육'), - ('눈꽃치킨'), - ('후라이드파닭'), - ('쏘핫간장치킨'), - ('간장파닭'), - ('치즈파닭'), - ('꿀맵닭'), - ('멸치국수'), - ('돔베고기'), - ('돼지국밥'), - ('선지해장국'), - ('왕갈비탕'), - ('벌집생삼겹살'), - ('매운간짜장'), - ('백짬뽕'), - ('고추짬뽕'), - ('고추잡채밥'), - ('착한특밥'), - ('삼선누룽지탕'), - ('연태주'), - ('딸기라떼'), - ('딸기에이드'), - ('딸기티'), - ('로제떡볶이'), - ('허니갈릭프라이'), - ('불고기치즈프라이'), - ('왕새우튀김'), - ('홉스순살치킨'), - ('홉스양념치킨'), - ('로제파스타치킨'), - ('크림파스타치킨'), - ('참치폭탄주먹밥'), - ('감자튀김 추가'), - ('음료수 사이즈업'), - ('리얼티라미수찰떡'), - ('리얼꿀 미니호떡'), - ('숯불고기 샐비'), - ('우삼겹 샐비'), - ('달걀 후라이'), - ('치즈'), - ('컵라면'), - ('에그 샌드위치'), - ('햄치즈 샌드위치'), - ('크랩 샌드위치'), - ('크로와상 샌드위치'), - ('밑반찬'), - ('알곱창'), - ('고구마치즈스틱'), - ('양념감자튀김'), - ('데리야끼막창'), - ('쏘방 라면'), - ('김치말이국수'), - ('순살블랙찜닭'), - ('순살레드찜닭'), - ('순살매콤로제찜닭'), - ('중독닭볶음탕'), - ('목삼겹살'), - ('땡초치킨'), - ('땡초 불 파닭'), - ('우삼겹짬뽕순두부탕'), - ('산더미마라전골'), - ('크리미어니언'), - ('햄왕창부대찌개'), - ('물총조개탕'), - ('조선 매운 우육탕'), - ('매운바지락술찜'), - ('땡초어니언치킨'), - ('청양고추마요치킨'), - ('고기듬뿍김치찌개'), - ('조선 우육탕'), - ('얼큰꼬치어묵탕'), - ('돼지김치두루치기'), - ('매콤제육볶음'), - ('조선 매운 우육면'), - ('조선 우육면'), - ('순살 치즈만땅 찜닭'), - ('똥집고금구이'), - ('킬바사소시지구이'), - ('소면'), - ('쫄뱅이'), - ('꿔바로우'), - ('삼치구이'), - ('묵은지 순살 닭볶음탕'), - ('백세주'), - ('치즈계란말이'), - ('우삼겹달걀폭탄떡볶이'), - ('우육면 + 꿔바로우'), - ('먹태구이'), - ('오지치즈후라이'), - ('짜게치'), - ('조개라면'), - ('간장계란밥'), - ('참치마요밥'), - ('마무리볶음밥'), - ('중화면사리'), - ('치즈사리'), - ('관자쇼마이 홍유초수'), - ('왕어혈교 홍유초수'), - ('세모 멘보샤'), - ('야채춘권'), - ('페페로니피자'), - ('청경채'), - ('숙주'), - ('크리스피 새우롤'), - ('마초 떡볶이'), - ('나 홀로 떡볶이'), - ('매콤로제 떡볶이'), - ('뚜껑김치 삼겹살'), - ('김치전골'), - ('팔도비빔면'), - ('냉동순대'), - ('모듬순대'), - ('얼큰순대국밥'), - ('얼큰우동국밥'), - ('순대전골'), - ('토핑추가'), - ('육회비빔밥'), - ('웰빙비빔밥'), - ('삼겹비빔밥'), - ('우삼겹비빔밥'), - ('할라피뇨통살버거'), - ('안동찜닭'), - ('편육'), - ('가자미회국수'), - ('낙지소면'), - ('간장석쇠불고기'), - ('매콤고추장불고기'), - ('춘천닭갈비'), - ('삼겹파전'), - ('순두부짬뽕'), - ('만두짬뽕'), - ('해물오뎅탕'), - ('알짬뽕'), - ('나가사끼짬뽕'), - ('돈코츠라멘'), - ('탄탄멘'), - ('간재미회국수'), - ('메밀소바'), - ('김치국수'), - ('유부초밥'), - ('스프 & 브레드'), - ('장봉뵈르'), - ('바질오일파스타'), - ('베이컨토마토파스타'), - ('햄치즈파니니'), - ('치킨파니니'), - ('머쉬룸파니니'), - ('카야잼버터토스트'), - ('티라미수'), - ('치즈케이크'), - ('크로플'), - ('리얼 티라미수 찰떡'), - ('에그샌드위치'), - ('햄치즈샌드위치'), - ('크랩샌드위치'), - ('크로와상샌드위치'), - ('쏘방라면'), - ('손두부찌개'), - ('묵은지닭볶음탕'), - ('햄 김치 볶음밥'), - ('국수 및 면류'), - ('해장라면'), - ('치킨 및 닭요리'), - ('허니벌꿀치킨'), - ('땡초치즈불닭'), - ('숯불무뼈닭발'), - ('가마솥 치킨 후라이드'), - ('가마솥 치킨 양념치킨'), - ('가마솥 치킨 갈릭소스'), - ('가마솥 치킨 순살 후라이드'), - ('가마솥 치킨 순살 양념치킨'), - ('가마솥 치킨 순살 갈릭소스'), - ('고기류'), - ('돼지양념갈비'), - ('목살소금구이'), - ('소불고기'), - ('오돌뼈볶음'), - ('사이드 및 기타'), - ('타코야끼'), - ('콘소메치킨'), - ('닭똥집튀김'), - ('닭껍질튀김'), - ('염통꼬치'), - ('닭껍질 꼬치구이'), - ('숯불 치즈새우'), - ('달콤채식단피자'), - ('킹새우통치킨피자'), - ('통치킨오믈렛피자'), - ('불고기파스타치킨'), - ('디저트 및 음료'), - ('생과일 파인애플샤베트'), - ('생과일 코코넛샤베트'), - ('요구르트 샤베트'), - ('주류 및 음료수'), - ('후루츠 하이볼'), - ('레몬 하이볼'), - ('깔라만시 하이볼'), - ('자몽 하이볼'), - ('망고하이볼'); diff --git a/src/main/resources/db/migration/V96__alter_shops_add_main_category_id_column.sql b/src/main/resources/db/migration/V96__alter_shops_add_main_category_id_column.sql deleted file mode 100644 index 6718e60fb7..0000000000 --- a/src/main/resources/db/migration/V96__alter_shops_add_main_category_id_column.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE `shops` - ADD COLUMN `main_category_id` INT UNSIGNED COMMENT '메인 카테고리 id', - ADD CONSTRAINT `FK_SHOPS_ON_SHOP_CATEGORIES` - FOREIGN KEY (`main_category_id`) - REFERENCES `shop_categories` (`id`); diff --git a/src/main/resources/db/migration/V97__alter_shop_categories_add_event_banner_image_url_column.sql b/src/main/resources/db/migration/V97__alter_shop_categories_add_event_banner_image_url_column.sql deleted file mode 100644 index 9131834864..0000000000 --- a/src/main/resources/db/migration/V97__alter_shop_categories_add_event_banner_image_url_column.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE shop_categories - ADD COLUMN event_banner_image_url VARCHAR(255) NULL COMMENT '이벤트 배너 이미지' diff --git a/src/main/resources/db/migration/V98__alter_order_index_to_shop_categories.sql b/src/main/resources/db/migration/V98__alter_order_index_to_shop_categories.sql deleted file mode 100644 index af3e856e6d..0000000000 --- a/src/main/resources/db/migration/V98__alter_order_index_to_shop_categories.sql +++ /dev/null @@ -1,11 +0,0 @@ -ALTER TABLE shop_categories ADD COLUMN order_index INT; - -UPDATE shop_categories sc -JOIN ( - SELECT id, ROW_NUMBER() OVER (ORDER BY id) AS new_order_index - FROM shop_categories -) AS oc -ON sc.id = oc.id -SET sc.order_index = oc.new_order_index; - -ALTER TABLE shop_categories MODIFY order_index INT NOT NULL; diff --git a/src/main/resources/db/migration/V99__add_filter_column_to_article_keywords.sql b/src/main/resources/db/migration/V99__add_filter_column_to_article_keywords.sql deleted file mode 100644 index 612281844d..0000000000 --- a/src/main/resources/db/migration/V99__add_filter_column_to_article_keywords.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE `article_keywords` - ADD COLUMN `is_filtered` TINYINT(1) NOT NULL DEFAULT 0; - -UPDATE `article_keywords` -SET `is_filtered` = 0; diff --git a/src/main/resources/db/migration/V9__alter_notificaion_modify_auditing.sql b/src/main/resources/db/migration/V9__alter_notificaion_modify_auditing.sql deleted file mode 100644 index 0e9c7352ee..0000000000 --- a/src/main/resources/db/migration/V9__alter_notificaion_modify_auditing.sql +++ /dev/null @@ -1,11 +0,0 @@ -alter table `notification` - modify created_at TIMESTAMP not null comment '생성 일자'; - -alter table `notification` - modify updated_at TIMESTAMP not null comment '수정 일자'; - -alter table `notification_subscribe` - modify created_at TIMESTAMP not null comment '생성 일자'; - -alter table `notification_subscribe` - modify updated_at TIMESTAMP not null comment '수정 일자';