Skip to content

Commit

Permalink
fix: flyway 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Soundbar91 committed Dec 1, 2024
1 parent 04a0ec2 commit 9e336c9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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;
6 changes: 6 additions & 0 deletions src/main/resources/db/migration/V106__update_semester_id.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 9e336c9

Please sign in to comment.