diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2016-03-12 09:45:28 -0800 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2016-03-26 11:39:07 -0700 |
commit | f25b476202b5ebe706a99fa586041c23b85acaa5 (patch) | |
tree | 6182163abc7fb07b3abec46047e257b96a453a2e /mediagoblin/errormiddleware.py | |
parent | 8a26b072989a2393f81916fa0e5d15071b1de265 (diff) | |
download | mediagoblin-f25b476202b5ebe706a99fa586041c23b85acaa5.tar.lz mediagoblin-f25b476202b5ebe706a99fa586041c23b85acaa5.tar.xz mediagoblin-f25b476202b5ebe706a99fa586041c23b85acaa5.zip |
Only run sqlalchemy-migrate migrations if we have to; separate foundations
The goal is to get things to the point where Alembic can run on its own
for new databases and initialize the whole database on its own. There
are risks to not doing so, see #5413 for details.
There's a lot more here that could removed or cleaned up once
sqlalchemy-migrate is *completely* removed in the future.
* mediagoblin/db/migration_tools.py (MigrationManager.foundations):
Removed attribute.
(MigrationManager.populate_table_foundations): Removed method.
(MigrationManager.init_or_migrate): Removed call to deprecated method.
(populate_table_foundations): New function, refactored from former
MigrationManager method of same name.
* mediagoblin/gmg_commands/dbupdate.py: Import populate_table_foundations.
(DatabaseData.foundations): Remove attribute.
(DatabaseData.make_migration_manager): Adjust instantiation of
MigrationManager.
(gather_database_data): Move out the work of building up foundations data.
(run_foundations): New method, incorporating logic for gathering and
running foundations which was previously spread across other
functions and methods.
(run_alembic_migrations): Remove deprecated comment.
(run_dbupdate): Only run sqlalchemy migrations if we have to.
Also run run_foundations if we are setting up this database for the
first time.
(sqam_migrations_to_run): New method.
Diffstat (limited to 'mediagoblin/errormiddleware.py')
0 files changed, 0 insertions, 0 deletions