Rename Forecast.training_horizon into .train_horizon
- we use that shorter name in `urban_meal_delivery.forecasts.*` and want to be consistent in the ORM layer as well
This commit is contained in:
parent
6fd16f2a6c
commit
3f5b4a50bb
5 changed files with 63 additions and 15 deletions
|
|
@ -0,0 +1,48 @@
|
|||
"""Rename `Forecast.training_horizon` into `.train_horizon`.
|
||||
|
||||
Revision: #8bfb928a31f8 at 2021-02-02 12:55:09
|
||||
Revises: #c2af85bada01
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from alembic import op
|
||||
|
||||
from urban_meal_delivery import configuration
|
||||
|
||||
|
||||
revision = '8bfb928a31f8'
|
||||
down_revision = 'c2af85bada01'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
config = configuration.make_config('testing' if os.getenv('TESTING') else 'production')
|
||||
|
||||
|
||||
def upgrade():
|
||||
"""Upgrade to revision 8bfb928a31f8."""
|
||||
op.execute(
|
||||
f"""
|
||||
ALTER TABLE
|
||||
{config.CLEAN_SCHEMA}.forecasts
|
||||
RENAME COLUMN
|
||||
training_horizon
|
||||
TO
|
||||
train_horizon;
|
||||
""",
|
||||
) # noqa:WPS355
|
||||
|
||||
|
||||
def downgrade():
|
||||
"""Downgrade to revision c2af85bada01."""
|
||||
op.execute(
|
||||
f"""
|
||||
ALTER TABLE
|
||||
{config.CLEAN_SCHEMA}.forecasts
|
||||
RENAME COLUMN
|
||||
train_horizon
|
||||
TO
|
||||
training_horizon;
|
||||
""",
|
||||
) # noqa:WPS355
|
||||
Loading…
Add table
Add a link
Reference in a new issue