From abd4246b40c0dff65a2ff4a576ad6ebab04a2076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez?= Date: Mon, 29 Oct 2012 14:03:00 +0000 Subject: [PATCH] Added "alter table character set" on creation to modify them to utf8 (better is to have database in utf8) --- server/src/uds/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/src/uds/__init__.py b/server/src/uds/__init__.py index f360247d..7febe31e 100644 --- a/server/src/uds/__init__.py +++ b/server/src/uds/__init__.py @@ -57,5 +57,9 @@ def modify_MySQL_storage(sender, **kwargs): if dicTables.has_key(db_table): stmt = 'ALTER TABLE %s ENGINE=%s' % (db_table,'InnoDB') 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)