Skip to content

Commit

Permalink
adding is_hidden to stg_services.button to sync with backend (#77)
Browse files Browse the repository at this point in the history
## Check-List
<!-- После сохранения у следующих полей появятся галочки, которые нужно
проставить мышкой -->
- [x] Вы проверили свой код перед отправкой запроса?
- [x] Вы написали тесты к реализованным функциям?
- [x] Вы не забыли применить форматирование `black` и `isort` для
_Back-End_ или `Prettier` для _Front-End_?
  • Loading branch information
Zimovchik authored Oct 6, 2024
1 parent 6588404 commit b65ef1f
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ def upgrade():


def downgrade():
op.drop_column('diff', 'action', schema='STG_RASPHYSMSU')
op.drop_column('diff', 'action', schema='STG_RASPHYSMSU')
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import sqlalchemy as sa
from alembic import op


# revision identifiers, used by Alembic.
revision = 'eba63ac1dd15'
down_revision = '0bf7c70b7034'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

import sqlalchemy as sa
from alembic import op

from sqlalchemy.dialects import postgresql


# revision identifiers, used by Alembic.
revision = 'f9426dfd57e2'
down_revision = 'eba63ac1dd15'
Expand Down
6 changes: 4 additions & 2 deletions migrations/versions/20240830_1700_f533a027d14a_new_w_dates.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 = 'f533a027d14a'
down_revision = 'f9426dfd57e2'
Expand Down
1 change: 1 addition & 0 deletions migrations/versions/20240830_1735_bc4897a9cadd_add_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import sqlalchemy as sa
from alembic import op


# revision identifiers, used by Alembic.
revision = 'bc4897a9cadd'
down_revision = 'f533a027d14a'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import sqlalchemy as sa
from alembic import op


# revision identifiers, used by Alembic.
revision = 'eebd0dbc6839'
down_revision = 'bc4897a9cadd'
Expand Down
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 = 'da280c5f1dac'
down_revision = 'eebd0dbc6839'
Expand Down
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 = '11461790578a'
down_revision = 'da280c5f1dac'
Expand Down
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 = '0e97fd76b68a'
down_revision = '11461790578a'
Expand Down
31 changes: 31 additions & 0 deletions migrations/versions/20241006_0726_5c0a5eb043d7_button_is_hidden.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""button_is_hidden
Revision ID: 5c0a5eb043d7
Revises: 0e97fd76b68a
Create Date: 2024-10-06 07:26:54.197863
"""

import os

import sqlalchemy as sa
from alembic import op


# revision identifiers, used by Alembic.
revision = '5c0a5eb043d7'
down_revision = '0e97fd76b68a'
branch_labels = None
depends_on = None


def upgrade():
op.add_column(
'button',
sa.Column('is_hidden', sa.Boolean(), nullable=False, server_default=sa.false()),
schema='STG_SERVICES',
)


def downgrade():
op.drop_column('button', 'is_hidden', schema='STG_SERVICES')
9 changes: 3 additions & 6 deletions profcomff_definitions/STG/rasphysmsu.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class New(Base):
teacher: Mapped[tp.List[int]] = mapped_column(ARRAY(Integer))
events_id: Mapped[tp.List[int] | None] = mapped_column(ARRAY(Integer))


class LinkNewWithDates(Base):
id: Mapped[int]
subject: Mapped[str | None]
Expand All @@ -74,9 +75,7 @@ class LinkNewWithDates(Base):
group: Mapped[tp.List[int]] = mapped_column(ARRAY(Integer))
teacher: Mapped[tp.List[int]] = mapped_column(ARRAY(Integer))
events_id: Mapped[tp.List[int] | None] = mapped_column(ARRAY(Integer))
__mapper_args__ = {
"primary_key": ["id", "start", "end"]
} # Used only to correctly map ORM object to sql table
__mapper_args__ = {"primary_key": ["id", "start", "end"]} # Used only to correctly map ORM object to sql table


class NewWithDates(Base):
Expand All @@ -92,6 +91,4 @@ class NewWithDates(Base):
group: Mapped[tp.List[int]] = mapped_column(ARRAY(Integer))
teacher: Mapped[tp.List[int]] = mapped_column(ARRAY(Integer))
events_id: Mapped[tp.List[int] | None] = mapped_column(ARRAY(Integer))
__mapper_args__ = {
"primary_key": ["id", "start", "end"]
} # Used only to correctly map ORM object to sql table
__mapper_args__ = {"primary_key": ["id", "start", "end"]} # Used only to correctly map ORM object to sql table
1 change: 1 addition & 0 deletions profcomff_definitions/STG/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Button(Base):
icon: Mapped[str | None]
link: Mapped[str | None]
type: Mapped[str | None]
is_hidden: Mapped[bool] = mapped_column(default=False)


class Scope(Base):
Expand Down

0 comments on commit b65ef1f

Please sign in to comment.