From 8c6b27b5b37daf815de10e9034ec777ad6c25a09 Mon Sep 17 00:00:00 2001 From: Griatch Date: Wed, 5 Oct 2011 21:49:43 +0200 Subject: [PATCH] Fixed a migration that failed under mysql. --- .../migrations/0001_rename_config_table_to_server_table.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server/migrations/0001_rename_config_table_to_server_table.py b/src/server/migrations/0001_rename_config_table_to_server_table.py index fc22c999a..d4077e7d0 100644 --- a/src/server/migrations/0001_rename_config_table_to_server_table.py +++ b/src/server/migrations/0001_rename_config_table_to_server_table.py @@ -6,14 +6,15 @@ from django.db import models, utils import pickle class Migration(SchemaMigration): - + + no_dry_run = True def forwards(self, orm): try: db.rename_table("config_configvalue", "server_serverconfig") for conf in orm.ServerConfig.objects.all(): conf.db_value = pickle.dumps(conf.db_value) conf.save() - except utils.DatabaseError: + except Exception: #utils.DatabaseError: # this will happen if we start db from scratch (the config # app will then already be gone and no data is to be transferred) # So instead of renaming the old we instead have to manually create the new model.