mirror of
				https://github.com/linux-do/new-api.git
				synced 2025-11-04 13:23:42 +08:00 
			
		
		
		
	enable mysql parseTime
This commit is contained in:
		@@ -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
 | 
			
		||||
		})
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user