diff --git a/migrations/versions/20241110_0936_0d19739e95cf_to_dwh.py b/migrations/versions/20241110_0936_0d19739e95cf_to_dwh.py index b681787e..6b88c7a6 100644 --- a/migrations/versions/20241110_0936_0d19739e95cf_to_dwh.py +++ b/migrations/versions/20241110_0936_0d19739e95cf_to_dwh.py @@ -6,11 +6,13 @@ """ -from alembic import op -import sqlalchemy as sa import os + +import sqlalchemy as sa +from alembic import op from sqlalchemy.dialects import postgresql + # revision identifiers, used by Alembic. revision = '0d19739e95cf' down_revision = '9fcb159af046' diff --git a/migrations/versions/20241110_1107_14b92d839a9b_monitoring.py b/migrations/versions/20241110_1107_14b92d839a9b_monitoring.py index 9300bbfd..7dc1a119 100644 --- a/migrations/versions/20241110_1107_14b92d839a9b_monitoring.py +++ b/migrations/versions/20241110_1107_14b92d839a9b_monitoring.py @@ -6,11 +6,13 @@ """ -from alembic import op -import sqlalchemy as sa import os + +import sqlalchemy as sa +from alembic import op from sqlalchemy.dialects import postgresql + # revision identifiers, used by Alembic. revision = '14b92d839a9b' down_revision = '0d19739e95cf' @@ -149,4 +151,4 @@ def downgrade(): op.delete_group( "test_dwh_dm_monitoring_read" if os.getenv("ENVIRONMENT") != "production" else "prod_dwh_dm_monitoring_read" ) - op.drop_table_schema("DM_MONITORING") \ No newline at end of file + op.drop_table_schema("DM_MONITORING") diff --git a/migrations/versions/20241110_1216_d56e230e4da9_fix.py b/migrations/versions/20241110_1216_d56e230e4da9_fix.py index 18ad98b2..687b29e3 100644 --- a/migrations/versions/20241110_1216_d56e230e4da9_fix.py +++ b/migrations/versions/20241110_1216_d56e230e4da9_fix.py @@ -6,11 +6,13 @@ """ -from alembic import op -import sqlalchemy as sa import os + +import sqlalchemy as sa +from alembic import op from sqlalchemy.dialects import postgresql + # revision identifiers, used by Alembic. revision = 'd56e230e4da9' down_revision = '14b92d839a9b' diff --git a/migrations/versions/20241110_1233_8ae074933b0d_fix2.py b/migrations/versions/20241110_1233_8ae074933b0d_fix2.py index 703c2e11..8c3ef59c 100644 --- a/migrations/versions/20241110_1233_8ae074933b0d_fix2.py +++ b/migrations/versions/20241110_1233_8ae074933b0d_fix2.py @@ -6,11 +6,13 @@ """ -from alembic import op -import sqlalchemy as sa import os + +import sqlalchemy as sa +from alembic import op from sqlalchemy.dialects import postgresql + # revision identifiers, used by Alembic. revision = '8ae074933b0d' down_revision = 'd56e230e4da9' diff --git a/migrations/versions/20241110_1321_4744a389ff0b_stg_union_member_middle_name_add.py b/migrations/versions/20241110_1321_4744a389ff0b_stg_union_member_middle_name_add.py new file mode 100644 index 00000000..a758236f --- /dev/null +++ b/migrations/versions/20241110_1321_4744a389ff0b_stg_union_member_middle_name_add.py @@ -0,0 +1,27 @@ +"""stg.union_member middle name add + +Revision ID: 4744a389ff0b +Revises: 8ae074933b0d +Create Date: 2024-11-10 13:21:39.696651 + +""" + +import os + +import sqlalchemy as sa +from alembic import op + + +# revision identifiers, used by Alembic. +revision = '4744a389ff0b' +down_revision = '8ae074933b0d' +branch_labels = None +depends_on = None + + +def upgrade(): + op.add_column('union_member', sa.Column('middle_name', sa.String(), nullable=True), schema='STG_UNION_MEMBER') + + +def downgrade(): + op.drop_column('union_member', 'middle_name', schema='STG_UNION_MEMBER') diff --git a/profcomff_definitions/DM/monitoring.py b/profcomff_definitions/DM/monitoring.py index 05b04365..b4a62de1 100644 --- a/profcomff_definitions/DM/monitoring.py +++ b/profcomff_definitions/DM/monitoring.py @@ -9,8 +9,11 @@ class DbMonitoringSnp(Base): """ Snapshot table that shows sizes for all tables in DWH """ + id: Mapped[int] - table_name: Mapped[str] = mapped_column(comment="Table name with schema name, ex. \"STG_TIMETABLE\".\"events_groups\"") + table_name: Mapped[str] = mapped_column( + comment="Table name with schema name, ex. \"STG_TIMETABLE\".\"events_groups\"" + ) table_schema: Mapped[str] = mapped_column(comment="Table schema, need for detalization, ex.\"STG_TIMETABLE\"") table_size_mb: Mapped[int] = mapped_column(comment="Table size in MB (int), ex. 8") indexes_size_mb: Mapped[int] = mapped_column(comment="Table indexes size in MB(int), ex.5") diff --git a/profcomff_definitions/STG/union_member.py b/profcomff_definitions/STG/union_member.py index df483f4f..a612c0f3 100644 --- a/profcomff_definitions/STG/union_member.py +++ b/profcomff_definitions/STG/union_member.py @@ -12,6 +12,7 @@ class UnionMember(Base): faculty: Mapped[str | None] first_name: Mapped[str | None] last_name: Mapped[str | None] + middle_name: Mapped[str | None] email: Mapped[str | None] date_of_birth: Mapped[str | None] phone_number: Mapped[str | None]