update model

This commit is contained in:
landaiqing
2024-09-10 22:27:46 +08:00
parent 1070a0c98e
commit e87a511ece
6 changed files with 13 additions and 2 deletions

View File

@@ -47,8 +47,9 @@ func MySQlConnect() *gorm.DB {
}
db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{
Logger: mysqlLogger,
PrepareStmt: true,
SkipDefaultTransaction: true,
Logger: mysqlLogger,
PrepareStmt: true,
})
if err != nil {
global.LOG.Fatalf(fmt.Sprintf("[%s] MySQL 连接失败", dsn))