Skip to content

Commit

Permalink
fix: 数据库迁移被外键约束影响
Browse files Browse the repository at this point in the history
  • Loading branch information
rehiy committed Jun 1, 2024
1 parent 0f63717 commit 18c8cd9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions service/server/origin.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ func dbConnect() {
Option: args.Gormio.Option,
})

// 实施自动迁移
migrator.Deploy()

// 开启外键约束
if args.Gormio.Type == "sqlite" {
dborm.Db.Exec("PRAGMA foreign_keys=ON;")
}

// 实施自动迁移
migrator.Deploy()

}

func httpServer() {
Expand Down

0 comments on commit 18c8cd9

Please sign in to comment.