From 80fdfb5e38c4acedc755fd7202d325976cc48107 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 30 Sep 2014 13:01:29 +0000 Subject: [PATCH] fix public_id migration for new installs --- pandora/item/migrations/0005_public_id.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandora/item/migrations/0005_public_id.py b/pandora/item/migrations/0005_public_id.py index 806e882b..fc5550ac 100644 --- a/pandora/item/migrations/0005_public_id.py +++ b/pandora/item/migrations/0005_public_id.py @@ -13,8 +13,9 @@ class Migration(SchemaMigration): db.rename_column('item_item', 'itemId', 'public_id') # Rename field 'ItemSort.itemId' to 'ItemSort.public_id' - db.rename_column('item_itemsort', 'itemId', 'public_id') - + itemsort = orm['item.ItemSort'] + if 'itemId' in [f.name for f in itemsort._meta.fields]: + db.rename_column('item_itemsort', 'itemId', 'public_id') def backwards(self, orm):