The seedbox.db.sqlalchemy.migration
Module¶
Provides ability to manage versions of database models
-
seedbox.db.sqlalchemy.migration.
db_sync
(engine, version=None, init_version=0)¶ Upgrade or downgrade a database.
Function runs the upgrade() or downgrade() functions in change scripts.
Parameters: - engine – SQLAlchemy engine instance for a given database
- version – Database will upgrade/downgrade until this version. If None - database will update to the latest available version.
- init_version – Initial database version
-
seedbox.db.sqlalchemy.migration.
db_version
(engine, init_version=0)¶ Show the current version of the repository.
Parameters: - engine – SQLAlchemy engine instance for a given database
- init_version – Initial database version
-
seedbox.db.sqlalchemy.migration.
db_version_control
(engine, version=None)¶ Mark a database as under this repository’s version control.
Once a database is under version control, schema changes should only be done via change scripts in this repository.
Parameters: - engine – SQLAlchemy engine instance for a given database
- version – Initial database version