-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #416 from Open-Earth-Foundation/fix/missing_column…
…s_country_code_table fix:adding_missing_columns
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
global-api/migrations/versions/949c5b9cc18d_ef_in_country_code_table.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |