From f48f62b6a09513a5a64fd58ee6330f0b3d622465 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 6 Mar 2013 16:21:41 +0000 Subject: [PATCH] can only delete after altering table --- pandora/sequence/migrations/0002_optimize1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora/sequence/migrations/0002_optimize1.py b/pandora/sequence/migrations/0002_optimize1.py index 8ecef888..42672703 100644 --- a/pandora/sequence/migrations/0002_optimize1.py +++ b/pandora/sequence/migrations/0002_optimize1.py @@ -8,7 +8,6 @@ from django.db import models class Migration(SchemaMigration): def forwards(self, orm): - orm['sequence.Sequence'].objects.all().delete() # Removing unique constraint on 'Sequence', fields ['item', 'end', 'mode', 'start'] db.delete_unique('sequence_sequence', ['item_id', 'end', 'mode', 'start']) @@ -32,6 +31,7 @@ class Migration(SchemaMigration): # Adding unique constraint on 'Sequence', fields ['sort', 'start', 'end', 'mode'] db.create_unique('sequence_sequence', ['sort_id', 'start', 'end', 'mode']) + orm['sequence.Sequence'].objects.all().delete() def backwards(self, orm): # Removing unique constraint on 'Sequence', fields ['sort', 'start', 'end', 'mode']