enable mysql parseTime

This commit is contained in:
CaIon 2023-12-27 15:33:35 +08:00
parent 16e1b559d2
commit 9c7456b0a6

View File

@ -52,6 +52,10 @@ func chooseDB() (*gorm.DB, error) {
}
// Use MySQL
common.SysLog("using MySQL as database")
// check parseTime
if !strings.Contains(dsn, "parseTime") {
dsn += "?parseTime=true"
}
return gorm.Open(mysql.Open(dsn), &gorm.Config{
PrepareStmt: true, // precompile SQL
})