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.
28 lines
582 B
Mako
28 lines
582 B
Mako
"""${message}."""
|
|
|
|
import os
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
${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")
|
|
|
|
|
|
def upgrade():
|
|
"""Upgrade to the next revision."""
|
|
${upgrades if upgrades else "pass"}
|
|
|
|
|
|
def downgrade():
|
|
"""Downgrade to the previous revision."""
|
|
${downgrades if downgrades else "pass"}
|