mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
fix: attempt to fix failing sqlite migrations (resolve #210)
This commit is contained in:
parent
25464e9519
commit
82b8951437
1
main.go
1
main.go
@ -115,6 +115,7 @@ func main() {
|
|||||||
db, err = gorm.Open(config.Db.GetDialector(), &gorm.Config{Logger: gormLogger})
|
db, err = gorm.Open(config.Db.GetDialector(), &gorm.Config{Logger: gormLogger})
|
||||||
if config.Db.Dialect == "sqlite3" {
|
if config.Db.Dialect == "sqlite3" {
|
||||||
db.Raw("PRAGMA foreign_keys = ON;")
|
db.Raw("PRAGMA foreign_keys = ON;")
|
||||||
|
db.DisableForeignKeyConstraintWhenMigrating = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.IsDev() {
|
if config.IsDev() {
|
||||||
|
@ -3,7 +3,7 @@ package models
|
|||||||
type ProjectLabel struct {
|
type ProjectLabel struct {
|
||||||
ID uint `json:"id" gorm:"primary_key"`
|
ID uint `json:"id" gorm:"primary_key"`
|
||||||
User *User `json:"-" gorm:"not null; constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
|
User *User `json:"-" gorm:"not null; constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
|
||||||
UserID string `json:"-" gorm:"not null; index:idx_language_mapping_user; index:idx_project_label_user"`
|
UserID string `json:"-" gorm:"not null; index:idx_project_label_user"`
|
||||||
ProjectKey string `json:"project"`
|
ProjectKey string `json:"project"`
|
||||||
Label string `json:"label" gorm:"type:varchar(64)"`
|
Label string `json:"label" gorm:"type:varchar(64)"`
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
1.28.0
|
1.28.1
|
||||||
|
Loading…
Reference in New Issue
Block a user