Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

cope with new databases

  • Loading branch information...
commit c04c4c6f551c6ed633cdd03a1990c51e2b342382 1 parent 8d8c34d
@andymckay andymckay authored
Showing with 11 additions and 3 deletions.
  1. +11 −3 migrations/32-populate-public-id.py
View
14 migrations/32-populate-public-id.py
@@ -1,9 +1,17 @@
import uuid
+from django.db.utils import DatabaseError
+
from lib.sellers.models import SellerProduct
def run():
- for seller in SellerProduct.objects.all():
- seller.public_id = str(uuid.uuid4())
- seller.save()
+ try:
+ for seller in SellerProduct.objects.all():
+ seller.public_id = str(uuid.uuid4())
+ seller.save()
+ except DatabaseError, exc:
+ if "Unknown column 'seller_product.access'" in str(exc):
+ # We don't need to worry about this migration then.
+ return
+ raise
Please sign in to comment.
Something went wrong with that request. Please try again.