Merge "PyMySQL 0.8.0 compat fix" into stable/pike

This commit is contained in:
Zuul 2018-01-19 02:11:34 +00:00 committed by Gerrit Code Review
commit 0c06a06fa4
1 changed files with 7 additions and 6 deletions

View File

@ -25,9 +25,10 @@ def upgrade(migrate_engine):
if migrate_engine.name != "mysql":
return
sql = """SET foreign_key_checks = 0;
ALTER TABLE service_statuses CONVERT TO CHARACTER SET utf8;
SET foreign_key_checks = 1;
ALTER DATABASE %s DEFAULT CHARACTER SET utf8;
""" % migrate_engine.url.database
migrate_engine.execute(sql)
migrate_engine.execute("SET foreign_key_checks = 0;")
migrate_engine.execute(
"ALTER TABLE service_statuses CONVERT TO CHARACTER SET utf8;")
migrate_engine.execute("SET foreign_key_checks = 1;")
migrate_engine.execute(
"ALTER DATABASE %s DEFAULT CHARACTER SET utf8;"
% migrate_engine.url.database)