db-no-create-all (BTDB002)¶
Added in 0.10.0 · Preview · Off by default (warning)
Family: database · Standard: CES-18 · Languages: python
This rule is unstable and in preview. It runs only with preview = true, and only when it is selected.
Directive¶
metadata.create_all(...) is reported outside the tests: the schema evolves through Alembic
migrations only. A warning by default.
Why¶
create_all builds the tables the models describe today and skips the ones a migration would
have changed, so the schema of a database and its migration history drift apart without a trace.
Do¶
Don't¶
Suppression¶
A comment on the line of the create_all(...) call silences it.