Move the call to install_migration_version_if_missing() to migrations_to_run()
This means there's a serious side effect of calling this, but there's no way to get useful data here unless if that's set anyway.
This commit is contained in:
parent
1b38cfa3b7
commit
9cf8b469e7
@ -231,7 +231,14 @@ class MigrationManager(object):
|
|||||||
def migrations_to_run(self):
|
def migrations_to_run(self):
|
||||||
"""
|
"""
|
||||||
Get a list of migrations to run still, if any.
|
Get a list of migrations to run still, if any.
|
||||||
|
|
||||||
|
Note that calling this will set your migration version to the
|
||||||
|
latest version if it isn't installed to anything yet!
|
||||||
"""
|
"""
|
||||||
|
# If we aren't set to any version number, presume we're at the
|
||||||
|
# latest (which means we'll do nothing here...)
|
||||||
|
self.install_migration_version_if_missing()
|
||||||
|
|
||||||
db_current_migration = self.database_current_migration()
|
db_current_migration = self.database_current_migration()
|
||||||
|
|
||||||
return [
|
return [
|
||||||
@ -251,11 +258,6 @@ class MigrationManager(object):
|
|||||||
run post-migration. Takes (migration_number, migration_func)
|
run post-migration. Takes (migration_number, migration_func)
|
||||||
as arguments
|
as arguments
|
||||||
"""
|
"""
|
||||||
# If we aren't set to any version number, presume we're at the
|
|
||||||
# latest (which means we'll do nothing here...)
|
|
||||||
# @@: should this be in migrations_to_run()?
|
|
||||||
self.install_migration_version_if_missing()
|
|
||||||
|
|
||||||
for migration_number, migration_func in self.migrations_to_run():
|
for migration_number, migration_func in self.migrations_to_run():
|
||||||
if pre_callback:
|
if pre_callback:
|
||||||
pre_callback(migration_number, migration_func)
|
pre_callback(migration_number, migration_func)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user