Skip to content

Commit

Permalink
added debugging statements to migrate20240327000000 to make sure th…
Browse files Browse the repository at this point in the history
…at `news_alert_files_file_fk` can never conflict
  • Loading branch information
CommanderStorm committed Mar 27, 2024
1 parent 71ba9da commit cad0080
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/backend/migration/20240327000000.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ func migrate20240327000000() *gormigrate.Migration {
if err := tx.Exec("alter table news_alert drop foreign key if exists news_alert").Error; err != nil {
return err
}
if err := tx.Exec("alter table news_alert drop foreign key if exists news_alert_files_file_fk").Error; err != nil {
return err
}
if err := tx.Exec("alter table news_alert add constraint news_alert_files_file_fk foreign key (file) references files (file) on delete cascade").Error; err != nil {
return err
}
Expand Down

0 comments on commit cad0080

Please sign in to comment.