From f106379b5382b2b82aa56466c8d3acaae58327a9 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 15 Jan 2013 21:29:30 -0600 Subject: Clean up and make several migrations modern This moves most migrations to the v2 format that have been presenting some issues. One missing depends_on relationship has been added, and we allow an index to not be dropped if it does not exist due to the shittyness in sqlite3 actually keeping indexes across DDL on that table. Signed-off-by: Dan McGee --- main/migrations/0055_unique_package_in_repo.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'main/migrations/0055_unique_package_in_repo.py') diff --git a/main/migrations/0055_unique_package_in_repo.py b/main/migrations/0055_unique_package_in_repo.py index 36cc7193..9ae33719 100644 --- a/main/migrations/0055_unique_package_in_repo.py +++ b/main/migrations/0055_unique_package_in_repo.py @@ -2,11 +2,16 @@ from south.db import db from south.v2 import SchemaMigration from django.db import models +from django.db.utils import DatabaseError class Migration(SchemaMigration): def forwards(self, orm): - db.delete_index('packages', ['pkgname']) + try: + db.delete_index('packages', ['pkgname']) + except DatabaseError as e: + if not 'no such index' in str(e): + raise e db.create_unique('packages', ['pkgname', 'repo_id', 'arch_id']) def backwards(self, orm): -- cgit v1.2.3-54-g00ecf