def record(migration, database): # Record us as having not done this record = MigrationHistory.for_migration(migration, database) if record.id is not None: if database != DEFAULT_DB_ALIAS: record.delete(using=database) else: # Django 1.1 always goes down here record.delete()
def record(migration, database): # Record us as having done this record = MigrationHistory.for_migration(migration, database) record.applied = datetime.datetime.utcnow() if database != DEFAULT_DB_ALIAS: record.save(using=database) else: # Django 1.1 and below always go down this branch. record.save()
def record(migration, database): # Record us as having done this record = MigrationHistory.for_migration(migration, database) try: from django.utils.timezone import now record.applied = now() except ImportError: record.applied = datetime.datetime.utcnow() if database != DEFAULT_DB_ALIAS: record.save(using=database) else: # Django 1.1 and below always go down this branch. record.save()
def record(migration): # Record us as having not done this record = MigrationHistory.for_migration(migration) if record.id is not None: record.delete()
def record(migration): # Record us as having done this record = MigrationHistory.for_migration(migration) record.applied = datetime.datetime.utcnow() record.save()
def record(app_name, migration): # Record us as having not done this record = MigrationHistory.for_migration(app_name, migration) record.delete()
def record(app_name, migration): # Record us as having done this record = MigrationHistory.for_migration(app_name, migration) record.applied = datetime.datetime.utcnow() record.save()