-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: #374 add enable/zone_enable column to dim_zone/fct_metrics to e…
…xclude some zone of processing
- Loading branch information
Showing
4 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
backend/alembic/versions/5801cb8f1af5_add_enable_field_to_dim_zone.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,37 @@ | ||
"""add enable field to dim_zone | ||
Revision ID: 5801cb8f1af5 | ||
Revises: 5bfe00a08853 | ||
Create Date: 2024-12-17 22:28:50.714813 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '5801cb8f1af5' | ||
down_revision = '5bfe00a08853' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
""" | ||
This evolution was motivated by the fact that some areas are PMA but contains | ||
some ports that are not registered. This leads to incorrect vessel activity | ||
The solution proposed here is to add enable column to dim_zone and fct_metrics | ||
to be able to choose if theses zone are took in account in aggregations or not | ||
even if they are present and calculated | ||
""" | ||
# add column enable | ||
op.add_column("dim_zone",sa.Column("enable",sa.Boolean(),nullable=False,default=True, server_default="True")) | ||
op.add_column("fct_metrics",sa.Column("zone_enable",sa.Boolean(),nullable=False,default=True, server_default="True")) | ||
pass | ||
|
||
|
||
def downgrade() -> None: | ||
op.drop_column("fct_metrics","zone_enable") | ||
op.drop_column("dim_zone","enable") | ||
pass |
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
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
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