example.db_schema¶
db_schema.py
Database schema update and seed functions - populate a new db with minimum data
created 31-mar-2019 by richb@instantlinux.net
Functions
|
run schema migrations |
|
open a db session scoped to flask context or celery thread |
|
Run alembic migrations for updating schema |
Classes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Exceptions
|
Wraps a DB-API OperationalError. |
|
Wraps a DB-API ProgrammingError. |
-
example.db_schema.
update
(db_engine, models, migrate=False, schema_maxtime=0)¶ Run alembic migrations for updating schema
Must be called with mutex for duration of update to prevent race conditions; begin_transaction() does not ensure mutual exclusion.
- params:
models - models to generate or update migrate - perform migrations only if True schema_maxtime - maximum seconds to wait for mutex