Skip to content

Commit

Permalink
add missing migration for supply risk parameters (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmmentel authored Nov 16, 2024
1 parent a3655be commit 1440104
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions alembic/versions/edad0a76e11e_add_supply_chain_attributes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
"""add supply chain attributes
Revision ID: edad0a76e11e
Revises: 55a636dde7bf
Create Date: 2024-11-12 18:24:05.169690
"""

# revision identifiers, used by Alembic.
revision = 'edad0a76e11e'
down_revision = '55a636dde7bf'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa


def upgrade():

op.add_column("elements", sa.Column("political_stability_of_top_producer", sa.Float))
op.add_column("elements", sa.Column("political_stability_of_top_reserve_holder", sa.Float))
op.add_column("elements", sa.Column("production_concentration", sa.Float))
op.add_column("elements", sa.Column("recycling_rate", sa.String))
op.add_column("elements", sa.Column("relative_supply_risk", sa.Float))
op.add_column("elements", sa.Column("reserve_distribution", sa.Float))
op.add_column("elements", sa.Column("substitutability", sa.String))
op.add_column("elements", sa.Column("top_3_producers", sa.String))
op.add_column("elements", sa.Column("top_3_reserve_holders", sa.String))


def downgrade():

with op.batch_alter_table("elements") as batch_op:
batch_op.drop_column("production_concentration")
batch_op.drop_column("relative_supply_risk")
batch_op.drop_column("reserve_distribution")
batch_op.drop_column("political_stability_of_top_producer")
batch_op.drop_column("political_stability_of_top_reserve_holder")
batch_op.drop_column("top_3_producers")
batch_op.drop_column("top_3_reserve_holders")
batch_op.drop_column("recycling_rate")
batch_op.drop_column("substitutability")

0 comments on commit 1440104

Please sign in to comment.