Skip to content

Commit 18c8cd9

Browse files
committed
fix: 数据库迁移被外键约束影响
1 parent 0f63717 commit 18c8cd9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

service/server/origin.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ func dbConnect() {
3434
Option: args.Gormio.Option,
3535
})
3636

37+
// 实施自动迁移
38+
migrator.Deploy()
39+
3740
// 开启外键约束
3841
if args.Gormio.Type == "sqlite" {
3942
dborm.Db.Exec("PRAGMA foreign_keys=ON;")
4043
}
4144

42-
// 实施自动迁移
43-
migrator.Deploy()
44-
4545
}
4646

4747
func httpServer() {

0 commit comments

Comments
 (0)