Simplify the docstrings of the migrations
The "Revision" and "Revises" lines and the revision hashes in `upgrade()` and `downgrade()` repeated the `revision` and `down_revision` variables; the creation date is in the file name.
This commit is contained in:
parent
f532aae588
commit
db2e00216d
1 changed files with 17 additions and 35 deletions
|
|
@ -1,8 +1,4 @@
|
|||
"""${message}.
|
||||
|
||||
Revision: # ${up_revision} at ${create_date}
|
||||
Revises: # ${down_revision | comma,n}
|
||||
"""
|
||||
"""${message}."""
|
||||
|
||||
import os
|
||||
|
||||
|
|
@ -12,20 +8,21 @@ ${imports if imports else ""}
|
|||
|
||||
from velofy import configuration
|
||||
|
||||
|
||||
revision = ${repr(up_revision)}
|
||||
down_revision = ${repr(down_revision)}
|
||||
branch_labels = ${repr(branch_labels)}
|
||||
depends_on = ${repr(depends_on)}
|
||||
|
||||
|
||||
config = configuration.make_config('testing' if os.getenv('TESTING') else 'production')
|
||||
config = configuration.make_config("testing" if os.getenv("TESTING") else "production")
|
||||
|
||||
|
||||
def upgrade():
|
||||
"""Upgrade to revision ${up_revision}."""
|
||||
"""Upgrade to the next revision."""
|
||||
${upgrades if upgrades else "pass"}
|
||||
|
||||
|
||||
def downgrade():
|
||||
"""Downgrade to revision ${down_revision}."""
|
||||
"""Downgrade to the previous revision."""
|
||||
${downgrades if downgrades else "pass"}
|
||||
|
|
|
|||
Loading…
Reference in a new issue