summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-01-19 02:11:34 +0000
committerGerrit Code Review <review@openstack.org>2018-01-19 02:11:34 +0000
commit0c06a06fa409e1aebf97eb136d25b017598e2f88 (patch)
tree7fe7a3c6dae357bbb0e6a140194f994a757d0e59
parent455f8f1817948b213e24c4eedbe056bdb2c6339d (diff)
parent80dc905a861e8eb3f7306fff6371a4fcfff45b52 (diff)
Merge "PyMySQL 0.8.0 compat fix" into stable/pike
-rw-r--r--designate/storage/impl_sqlalchemy/migrate_repo/versions/098_fix_service_charset.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/designate/storage/impl_sqlalchemy/migrate_repo/versions/098_fix_service_charset.py b/designate/storage/impl_sqlalchemy/migrate_repo/versions/098_fix_service_charset.py
index c5bff96..14f47c2 100644
--- a/designate/storage/impl_sqlalchemy/migrate_repo/versions/098_fix_service_charset.py
+++ b/designate/storage/impl_sqlalchemy/migrate_repo/versions/098_fix_service_charset.py
@@ -25,9 +25,10 @@ def upgrade(migrate_engine):
25 if migrate_engine.name != "mysql": 25 if migrate_engine.name != "mysql":
26 return 26 return
27 27
28 sql = """SET foreign_key_checks = 0; 28 migrate_engine.execute("SET foreign_key_checks = 0;")
29 ALTER TABLE service_statuses CONVERT TO CHARACTER SET utf8; 29 migrate_engine.execute(
30 SET foreign_key_checks = 1; 30 "ALTER TABLE service_statuses CONVERT TO CHARACTER SET utf8;")
31 ALTER DATABASE %s DEFAULT CHARACTER SET utf8; 31 migrate_engine.execute("SET foreign_key_checks = 1;")
32 """ % migrate_engine.url.database 32 migrate_engine.execute(
33 migrate_engine.execute(sql) 33 "ALTER DATABASE %s DEFAULT CHARACTER SET utf8;"
34 % migrate_engine.url.database)