mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
chore: improve summary id fixing migration (see #416)
This commit is contained in:
parent
fbae5f8757
commit
33d259592c
@ -60,6 +60,17 @@ func init() {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// https://github.com/muety/wakapi/issues/416#issuecomment-1271674792
|
||||||
|
if db.Migrator().HasConstraint(&models.SummaryItem{}, "fk_summary_items_summary") {
|
||||||
|
if err := db.Migrator().DropConstraint(&models.SummaryItem{}, "fk_summary_items_summary"); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if db.Migrator().HasConstraint(&models.SummaryItem{}, "fk_summaries_labels") {
|
||||||
|
if err := db.Migrator().DropConstraint(&models.SummaryItem{}, "fk_summaries_labels"); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if err := db.Migrator().AlterColumn(&models.Summary{}, "id"); err != nil {
|
if err := db.Migrator().AlterColumn(&models.Summary{}, "id"); err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user