From 988f3f70878648ed9ef57a0f7abb6a9b293cc8f1 Mon Sep 17 00:00:00 2001 From: mfonsecaOEF Date: Wed, 3 Apr 2024 14:19:43 -0600 Subject: [PATCH] fix:adding_missing_columns --- .../949c5b9cc18d_ef_in_country_code_table.py | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 global-api/migrations/versions/949c5b9cc18d_ef_in_country_code_table.py diff --git a/global-api/migrations/versions/949c5b9cc18d_ef_in_country_code_table.py b/global-api/migrations/versions/949c5b9cc18d_ef_in_country_code_table.py new file mode 100644 index 000000000..0dfcbf6cd --- /dev/null +++ b/global-api/migrations/versions/949c5b9cc18d_ef_in_country_code_table.py @@ -0,0 +1,28 @@ +"""EF_in_country_code_table + +Revision ID: 949c5b9cc18d +Revises: 583858ff1aa8 +Create Date: 2024-04-03 10:24:31.131245 + +""" +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision: str = '949c5b9cc18d' +down_revision: Union[str, None] = '583858ff1aa8' +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + op.alter_column("country_code", "emission_factor_value", nullable=True, type_=sa.Float) + op.alter_column("country_code", "emission_factor_units", nullable=True, type_=sa.String) + + +def downgrade() -> None: + op.drop_column("country_code", "emission_factor_value", nullable=False, type_=sa.Float) + op.drop_column("country_code", "emission_factor_units", nullable=False, type_=sa.String)