示例#1
0
 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()
示例#2
0
 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()
示例#3
0
 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()
示例#4
0
 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()
示例#5
0
 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()
示例#6
0
 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()
示例#7
0
 def record(migration):
     # Record us as having not done this
     record = MigrationHistory.for_migration(migration)
     if record.id is not None:
         record.delete()
示例#8
0
 def record(migration):
     # Record us as having done this
     record = MigrationHistory.for_migration(migration)
     record.applied = datetime.datetime.utcnow()
     record.save()
示例#9
0
 def record(app_name, migration):
     # Record us as having not done this
     record = MigrationHistory.for_migration(app_name, migration)
     record.delete()
示例#10
0
 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()
示例#11
0
 def record(migration):
     # Record us as having not done this
     record = MigrationHistory.for_migration(migration)
     if record.id is not None:
         record.delete()