Skip to content

Commit

Permalink
stg_union_member middle name add (#95)
Browse files Browse the repository at this point in the history
## Изменения
<!-- Опишите здесь на языке, понятном каждому, изменения, сделанные в
исходном коде по пунктам. -->

## Детали реализации
<!-- Здесь можно описать технические детали по пунктам. -->

## Check-List
<!-- После сохранения у следующих полей появятся галочки, которые нужно
проставить мышкой -->
- [ ] Вы проверили свой код перед отправкой запроса?
- [ ] Вы написали тесты к реализованным функциям?
- [ ] Вы не забыли применить форматирование `black` и `isort` для
_Back-End_ или `Prettier` для _Front-End_?
  • Loading branch information
Zimovchik authored Nov 10, 2024
1 parent 2f273fe commit b7baee3
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 10 deletions.
6 changes: 4 additions & 2 deletions migrations/versions/20241110_0936_0d19739e95cf_to_dwh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 5 additions & 3 deletions migrations/versions/20241110_1107_14b92d839a9b_monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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")
op.drop_table_schema("DM_MONITORING")
6 changes: 4 additions & 2 deletions migrations/versions/20241110_1216_d56e230e4da9_fix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 4 additions & 2 deletions migrations/versions/20241110_1233_8ae074933b0d_fix2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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')
5 changes: 4 additions & 1 deletion profcomff_definitions/DM/monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions profcomff_definitions/STG/union_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit b7baee3

Please sign in to comment.