mirror of
				https://github.com/veops/cmdb.git
				synced 2025-11-04 13:46:17 +08:00 
			
		
		
		
	feat(db): set variable sql_mode
feat(db): set variable sql_mode
This commit is contained in:
		@@ -89,6 +89,16 @@ def db_setup():
 | 
			
		||||
    """
 | 
			
		||||
    db.create_all()
 | 
			
		||||
 | 
			
		||||
    db.session.execute("set global sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,"
 | 
			
		||||
                       "ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'")
 | 
			
		||||
    db.session.commit()
 | 
			
		||||
 | 
			
		||||
    try:
 | 
			
		||||
        db.session.execute("set global tidb_enable_noop_functions='ON'")
 | 
			
		||||
        db.session.commit()
 | 
			
		||||
    except:
 | 
			
		||||
        pass
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@click.group()
 | 
			
		||||
def translate():
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user