|
| 1 | +"""Add properties column to forecast_value |
| 2 | +
|
| 3 | +Revision ID: a6fb75892950 |
| 4 | +Revises: 08ba6879b865 |
| 5 | +Create Date: 2023-07-03 11:00:31.216789 |
| 6 | +
|
| 7 | +""" |
| 8 | +from alembic import op |
| 9 | +import sqlalchemy as sa |
| 10 | +from sqlalchemy.dialects import postgresql |
| 11 | + |
| 12 | +# revision identifiers, used by Alembic. |
| 13 | +revision = 'a6fb75892950' |
| 14 | +down_revision = '08ba6879b865' |
| 15 | +branch_labels = None |
| 16 | +depends_on = None |
| 17 | + |
| 18 | + |
| 19 | +def upgrade(): #noqa |
| 20 | + # ### commands auto generated by Alembic - please adjust! ### |
| 21 | + |
| 22 | + op.add_column('forecast_value', sa.Column('properties', sa.JSON(), nullable=True)) |
| 23 | + op.add_column('forecast_value_2022_09', sa.Column('properties', sa.JSON(), nullable=True)) |
| 24 | + op.add_column('forecast_value_2022_10', sa.Column('properties', sa.JSON(), nullable=True)) |
| 25 | + op.add_column('forecast_value_2022_11', sa.Column('properties', sa.JSON(), nullable=True)) |
| 26 | + op.add_column('forecast_value_2022_12', sa.Column('properties', sa.JSON(), nullable=True)) |
| 27 | + op.add_column('forecast_value_2023_01', sa.Column('properties', sa.JSON(), nullable=True)) |
| 28 | + op.add_column('forecast_value_2023_02', sa.Column('properties', sa.JSON(), nullable=True)) |
| 29 | + op.add_column('forecast_value_2023_03', sa.Column('properties', sa.JSON(), nullable=True)) |
| 30 | + op.add_column('forecast_value_2023_04', sa.Column('properties', sa.JSON(), nullable=True)) |
| 31 | + op.add_column('forecast_value_2023_05', sa.Column('properties', sa.JSON(), nullable=True)) |
| 32 | + op.add_column('forecast_value_2023_06', sa.Column('properties', sa.JSON(), nullable=True)) |
| 33 | + op.add_column('forecast_value_2023_07', sa.Column('properties', sa.JSON(), nullable=True)) |
| 34 | + op.add_column('forecast_value_2023_08', sa.Column('properties', sa.JSON(), nullable=True)) |
| 35 | + op.add_column('forecast_value_2023_09', sa.Column('properties', sa.JSON(), nullable=True)) |
| 36 | + op.add_column('forecast_value_2023_10', sa.Column('properties', sa.JSON(), nullable=True)) |
| 37 | + op.add_column('forecast_value_2023_11', sa.Column('properties', sa.JSON(), nullable=True)) |
| 38 | + op.add_column('forecast_value_2023_12', sa.Column('properties', sa.JSON(), nullable=True)) |
| 39 | + op.add_column('forecast_value_last_seven_days', sa.Column('properties', sa.JSON(), nullable=True)) |
| 40 | + op.add_column('forecast_value_latest', sa.Column('properties', sa.JSON(), nullable=True)) |
| 41 | + op.add_column('forecast_value_old', sa.Column('properties', sa.JSON(), nullable=True)) |
| 42 | + # ### end Alembic commands ### |
| 43 | + |
| 44 | + |
| 45 | +def downgrade(): #noqa |
| 46 | + # ### commands auto generated by Alembic - please adjust! ### |
| 47 | + op.drop_column('forecast_value_old', 'properties') |
| 48 | + op.drop_column('forecast_value_latest', 'properties') |
| 49 | + op.drop_column('forecast_value_last_seven_days', 'properties') |
| 50 | + op.drop_column('forecast_value_2023_12', 'properties') |
| 51 | + op.drop_column('forecast_value_2023_11', 'properties') |
| 52 | + op.drop_column('forecast_value_2023_10', 'properties') |
| 53 | + op.drop_column('forecast_value_2023_09', 'properties') |
| 54 | + op.drop_column('forecast_value_2023_08', 'properties') |
| 55 | + op.drop_column('forecast_value_2023_07', 'properties') |
| 56 | + op.drop_column('forecast_value_2023_06', 'properties') |
| 57 | + op.drop_column('forecast_value_2023_05', 'properties') |
| 58 | + op.drop_column('forecast_value_2023_04', 'properties') |
| 59 | + op.drop_column('forecast_value_2023_03', 'properties') |
| 60 | + op.drop_column('forecast_value_2023_02', 'properties') |
| 61 | + op.drop_column('forecast_value_2023_01', 'properties') |
| 62 | + op.drop_column('forecast_value_2022_12', 'properties') |
| 63 | + op.drop_column('forecast_value_2022_11', 'properties') |
| 64 | + op.drop_column('forecast_value_2022_10', 'properties') |
| 65 | + op.drop_column('forecast_value_2022_09', 'properties') |
| 66 | + op.drop_column('forecast_value', 'properties') |
| 67 | + |
| 68 | + # ### end Alembic commands ### |
0 commit comments