Skip to content
Snippets Groups Projects
Verified Commit 196c9694 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

fix: remove on show_name & add them on show_id :face_palm:

parent 485c7ec4
No related branches found
No related tags found
No related merge requests found
...@@ -326,6 +326,18 @@ var ( ...@@ -326,6 +326,18 @@ var (
Entries []PlaylistEntry `json:"entries"` Entries []PlaylistEntry `json:"entries"`
} }
if err := tx.Model(&File{}).RemoveForeignKey("show_name", "show (name)").Error; err != nil {
return err
}
if err := tx.Model(&Playlist{}).RemoveForeignKey("show_name", "show (name)").Error; err != nil {
return err
}
if err := tx.Model(&Playlist{}).AddForeignKey("show_id", "shows (id)", "CASCADE", "CASCADE").Error; err != nil {
return err
}
if err := tx.Model(&File{}).AddForeignKey("show_id", "shows (id)", "CASCADE", "CASCADE").Error; err != nil {
return err
}
return tx.AutoMigrate(&Show{}, &File{}, &Playlist{}).Error return tx.AutoMigrate(&Show{}, &File{}, &Playlist{}).Error
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment