From cb60ca13a9cb98f6ce16e010543e95db498009b3 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 16 Jan 2012 11:58:14 +0530 Subject: [PATCH] added patch to convert tables to utf8 --- .../patches/jan_mar_2012/convert_tables_to_utf8.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 erpnext/patches/jan_mar_2012/convert_tables_to_utf8.py diff --git a/erpnext/patches/jan_mar_2012/convert_tables_to_utf8.py b/erpnext/patches/jan_mar_2012/convert_tables_to_utf8.py new file mode 100644 index 00000000000..1ae94a7dcd6 --- /dev/null +++ b/erpnext/patches/jan_mar_2012/convert_tables_to_utf8.py @@ -0,0 +1,11 @@ +import webnotes + +def execute(): + sql = webnotes.conn.sql + + sql("commit") + sql("set foreign_key_checks=0") + for tab in sql("show tables"): + sql("ALTER TABLE `%s` CONVERT TO CHARACTER SET utf8" % tab[0]) + + sql("set foreign_key_checks=1")