Commit 6004ef3f authored by ibuler's avatar ibuler

[Update] 修改settings

parent e76392a1
...@@ -10,8 +10,10 @@ class Migration(migrations.Migration): ...@@ -10,8 +10,10 @@ class Migration(migrations.Migration):
] ]
sql = "INSERT INTO setting(name, value, category, encrypted, enabled, comment) " \ sql = "INSERT INTO setting(name, value, category, encrypted, enabled, comment) " \
"SELECT name, value, category, encrypted, enabled, comment from settings" "SELECT name, value, category, encrypted, enabled, comment from settings"
rename_sql = "RENAME TABLE settings TO settings_bak"
settings_table_exist = 'settings' in connection.introspection.table_names() settings_table_exist = 'settings' in connection.introspection.table_names()
operations = [] operations = []
if settings_table_exist: if settings_table_exist:
operations.append(migrations.RunSQL(sql)) operations.append(migrations.RunSQL(sql))
operations.append(migrations.RunSQL(rename_sql))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment