From 6004ef3f0df707a8b0d498457496444c9a98233d Mon Sep 17 00:00:00 2001 From: ibuler Date: Mon, 4 Mar 2019 10:53:49 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9settings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/settings/migrations/0002_migrate_data.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/settings/migrations/0002_migrate_data.py b/apps/settings/migrations/0002_migrate_data.py index 0d76d1386..3e36a14b8 100644 --- a/apps/settings/migrations/0002_migrate_data.py +++ b/apps/settings/migrations/0002_migrate_data.py @@ -10,8 +10,10 @@ class Migration(migrations.Migration): ] sql = "INSERT INTO setting(name, value, category, encrypted, enabled, comment) " \ "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() operations = [] if settings_table_exist: operations.append(migrations.RunSQL(sql)) + operations.append(migrations.RunSQL(rename_sql))