Excepting that migration 1 doesn't work(!), sqlalchemy migration branch working
The reason migration 1 doesn't work, and is commented out, is because of sqlalchemy-migrate not handling certain constraints while dropping binary sqlite columns right. See also: http://code.google.com/p/sqlalchemy-migrate/issues/detail?id=143&thanks=143&ts=1327882242
This commit is contained in:
@@ -103,11 +103,12 @@ class MigrationManager(object):
|
||||
|
||||
return self.migration_data.version
|
||||
|
||||
def set_current_migration(self, migration_number):
|
||||
def set_current_migration(self, migration_number=None):
|
||||
"""
|
||||
Set the migration in the database to migration_number
|
||||
(or, the latest available)
|
||||
"""
|
||||
self.migration_data = migration_number
|
||||
self.migration_data.version = migration_number or self.latest_migration
|
||||
self.session.commit()
|
||||
|
||||
def migrations_to_run(self):
|
||||
@@ -206,6 +207,7 @@ class MigrationManager(object):
|
||||
self.create_new_migration_record()
|
||||
|
||||
self.printer(u"done.\n")
|
||||
self.set_current_migration()
|
||||
return u'inited'
|
||||
|
||||
# Run migrations, if appropriate.
|
||||
@@ -220,6 +222,7 @@ class MigrationManager(object):
|
||||
migration_func(self.session)
|
||||
self.printer('done.\n')
|
||||
|
||||
self.set_current_migration()
|
||||
return u'migrated'
|
||||
|
||||
# Otherwise return None. Well it would do this anyway, but
|
||||
|
||||
Reference in New Issue
Block a user