def forwards(self, orm): with transaction(): db.execute("drop index one_activity_per_checkin") with transaction(): db.execute("""CREATE UNIQUE INDEX "one_activity_per_checkin_and_lang" on "useractivity_useractivity"("checkin_id", "LANG") WHERE "checkin_id" IS NOT NULL""")
def forwards(self, orm): with transaction(): db.execute("drop index one_activity_per_checkin") with transaction(): db.execute( """CREATE UNIQUE INDEX "one_activity_per_checkin_and_lang" on "useractivity_useractivity"("checkin_id", "LANG") WHERE "checkin_id" IS NOT NULL""")
def forwards(self, orm): with transaction(): # Removing unique constraint on 'ExternalLink', fields ['url', 'person'] db.delete_unique('externallink_externallink', ['url', 'person_id']) with transaction(): # Removing unique constraint on 'ExternalLink', fields ['url', 'film'] db.delete_unique('externallink_externallink', ['url', 'film_id']) # Adding unique constraint on 'ExternalLink', fields ['url', 'LANG', 'film'] db.create_unique('externallink_externallink', ['url', 'LANG', 'film_id']) db.create_unique('externallink_externallink', ['url', 'person_id', 'LANG'])
def forwards(self, orm): # Removing unique constraint on 'Tag', fields ['name'] with transaction(): db.delete_unique('tagging_tag', ['name']) # Adding unique constraint on 'Tag', fields ['LANG', 'name'] db.create_unique('tagging_tag', ['LANG', 'name'])
def forwards(self, orm): "Write your forwards methods here." from film20.utils.db import transaction query = orm.Cinema.objects.filter(fetcher1_id__isnull=False) total = query.count() for i, c in enumerate(query): print i+1, c.id, c.name, c.fetcher1_id with transaction(): orm.Fetcher.objects.get_or_create(name='google', cid="%s|%s" % (c.fetcher1_id, c.town.country.code), channel=c)
def forwards(self, orm): "Write your forwards methods here." from film20.utils.db import transaction query = orm.Cinema.objects.filter(fetcher1_id__isnull=False) total = query.count() for i, c in enumerate(query): print i + 1, c.id, c.name, c.fetcher1_id with transaction(): orm.Fetcher.objects.get_or_create( name='google', cid="%s|%s" % (c.fetcher1_id, c.town.country.code), channel=c)