From 18c8cd98fb3a5a37b031dcc193de80032c419bc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=A5=E6=B5=B7?= Date: Sat, 1 Jun 2024 22:52:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=95=B0=E6=8D=AE=E5=BA=93=E8=BF=81?= =?UTF-8?q?=E7=A7=BB=E8=A2=AB=E5=A4=96=E9=94=AE=E7=BA=A6=E6=9D=9F=E5=BD=B1?= =?UTF-8?q?=E5=93=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/server/origin.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service/server/origin.go b/service/server/origin.go index b9f9f848..c73662ea 100644 --- a/service/server/origin.go +++ b/service/server/origin.go @@ -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() {