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;