Browse Source

Merge "PyMySQL 0.8.0 compat fix" into stable/pike

tags/5.0.2
Zuul 1 year ago
parent
commit
0c06a06fa4

+ 7
- 6
designate/storage/impl_sqlalchemy/migrate_repo/versions/098_fix_service_charset.py View File

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

Loading…
Cancel
Save