forked from shaba/openuds
Added "alter table character set" on creation to modify them to utf8 (better is to have database in utf8)
This commit is contained in:
parent
b8c5678bde
commit
abd4246b40
@ -57,5 +57,9 @@ def modify_MySQL_storage(sender, **kwargs):
|
|||||||
if dicTables.has_key(db_table):
|
if dicTables.has_key(db_table):
|
||||||
stmt = 'ALTER TABLE %s ENGINE=%s' % (db_table,'InnoDB')
|
stmt = 'ALTER TABLE %s ENGINE=%s' % (db_table,'InnoDB')
|
||||||
cursor.execute(stmt)
|
cursor.execute(stmt)
|
||||||
|
# sets charset to utf8
|
||||||
|
stmt = 'ALTER TABLE %s CHARACTER SET \'utf8\' COLLATE \'utf8_general_ci\'' % db_table
|
||||||
|
cursor.execute(stmt)
|
||||||
|
|
||||||
|
|
||||||
signals.post_syncdb.connect(modify_MySQL_storage, sender=models)
|
signals.post_syncdb.connect(modify_MySQL_storage, sender=models)
|
||||||
|
Loading…
Reference in New Issue
Block a user