PyMySQL 0.8.0 compat fix
In PyMySQL the "MULTI_STATEMENT" flag has been disabled by default. (see PyMySQL/PyMySQL#590 ) Migration 98 had a single string with multiple statements ran in a single execution. Moving this to multiple executions of the same statements allows the migration to succeed with the new behaviour. Caused-By: PyMySQL/PyMySQL@c0aa317940 Change-Id: I5f6d92f695c4c5830b8595b0cecbbafb426470a1
This commit is contained in:
parent
53d6dc069e
commit
c1a77a3ae0
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue