mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-17 16:06:38 +08:00
enable mysql parseTime
This commit is contained in:
parent
7cd1261a81
commit
6ad2544415
@ -52,6 +52,10 @@ func chooseDB() (*gorm.DB, error) {
|
|||||||
}
|
}
|
||||||
// Use MySQL
|
// Use MySQL
|
||||||
common.SysLog("using MySQL as database")
|
common.SysLog("using MySQL as database")
|
||||||
|
// check parseTime
|
||||||
|
if !strings.Contains(dsn, "parseTime") {
|
||||||
|
dsn += "?parseTime=true"
|
||||||
|
}
|
||||||
return gorm.Open(mysql.Open(dsn), &gorm.Config{
|
return gorm.Open(mysql.Open(dsn), &gorm.Config{
|
||||||
PrepareStmt: true, // precompile SQL
|
PrepareStmt: true, // precompile SQL
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user