Commits

Mikhail Korobov  committed e0e54df

Fix BB-19 for sqlite (it was a South bug)

  • Participants
  • Parent commits 849f4d7

Comments (0)

Files changed (1)

File easy_maps/migrations/0005_auto__add_unique_address_address.py

 class Migration(SchemaMigration):
 
     def forwards(self, orm):
+
         # Removing index on 'Address', fields ['address']
-        db.delete_index('easy_maps_address', ['address'])
+        if db.backend_name != 'sqlite3':
+            # South forgets indexes when altering tables in sqlite,
+            # see http://south.aeracode.org/ticket/757 .
+            # This means delete_index will raise an exception with sqlite
+            # because the index is 'forgotten' in previous migrations.
+            db.delete_index('easy_maps_address', ['address'])
 
         # Adding unique constraint on 'Address', fields ['address']
         db.create_unique('easy_maps_address', ['address'])
         }
     }
 
-    complete_apps = ['easy_maps']
+    complete_apps = ['easy_maps']