From 9e336c9490b29ce2571f1eec2408ea80caca1a56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=8B=A0=EA=B4=80=EA=B7=9C?= Date: Sun, 1 Dec 2024 15:14:06 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20flyway=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...=> V103__alter_timetable_lecture_class_place_column.sql} | 0 ...re_class_time.sql => V104__alter_lecture_class_time.sql} | 0 .../resources/db/migration/V105__add_semester_id_column.sql | 6 ------ .../resources/db/migration/V106__update_semester_id.sql | 6 ++++++ 4 files changed, 6 insertions(+), 6 deletions(-) rename src/main/resources/db/migration/{V104__alter_timetable_lecture_class_place_column.sql => V103__alter_timetable_lecture_class_place_column.sql} (100%) rename src/main/resources/db/migration/{V103__alter_lecture_class_time.sql => V104__alter_lecture_class_time.sql} (100%) diff --git a/src/main/resources/db/migration/V104__alter_timetable_lecture_class_place_column.sql b/src/main/resources/db/migration/V103__alter_timetable_lecture_class_place_column.sql similarity index 100% rename from src/main/resources/db/migration/V104__alter_timetable_lecture_class_place_column.sql rename to src/main/resources/db/migration/V103__alter_timetable_lecture_class_place_column.sql diff --git a/src/main/resources/db/migration/V103__alter_lecture_class_time.sql b/src/main/resources/db/migration/V104__alter_lecture_class_time.sql similarity index 100% rename from src/main/resources/db/migration/V103__alter_lecture_class_time.sql rename to src/main/resources/db/migration/V104__alter_lecture_class_time.sql diff --git a/src/main/resources/db/migration/V105__add_semester_id_column.sql b/src/main/resources/db/migration/V105__add_semester_id_column.sql index 047c89fd6..a40959db7 100644 --- a/src/main/resources/db/migration/V105__add_semester_id_column.sql +++ b/src/main/resources/db/migration/V105__add_semester_id_column.sql @@ -1,8 +1,2 @@ ALTER TABLE `koin`.`lectures` ADD COLUMN `semester_id` INT UNSIGNED NOT NULL; - -ALTER TABLE `koin`.`lectures` - ADD CONSTRAINT `FK_LECTURES_ON_SEMESTER` - FOREIGN KEY (`semester_id`) - REFERENCES `koin`.`semester` (`id`) - ON UPDATE CASCADE; diff --git a/src/main/resources/db/migration/V106__update_semester_id.sql b/src/main/resources/db/migration/V106__update_semester_id.sql index 6a5d81e4a..adbe82b77 100644 --- a/src/main/resources/db/migration/V106__update_semester_id.sql +++ b/src/main/resources/db/migration/V106__update_semester_id.sql @@ -2,3 +2,9 @@ UPDATE `koin`.`lectures` l SET `semester_id` = (SELECT `id` FROM `koin`.`semester` s WHERE l.`semester_date` = s.`semester`); + +ALTER TABLE `koin`.`lectures` + ADD CONSTRAINT `FK_LECTURES_ON_SEMESTER` + FOREIGN KEY (`semester_id`) + REFERENCES `koin`.`semester` (`id`) + ON UPDATE CASCADE;