Skip to content

Commit

Permalink
fixess
Browse files Browse the repository at this point in the history
  • Loading branch information
parfenovma committed Aug 30, 2024
1 parent 21e81a9 commit 55e350a
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
"""add_link_full_schema
Revision ID: eebd0dbc6839
Revises: bc4897a9cadd
Create Date: 2024-08-30 17:54:35.609023
"""

import os

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = 'eebd0dbc6839'
down_revision = 'bc4897a9cadd'
branch_labels = None
depends_on = None


def upgrade():
op.add_column('link_new_with_dates', sa.Column('odd', sa.Boolean(), nullable=False), schema='STG_RASPHYSMSU')
op.add_column('link_new_with_dates', sa.Column('even', sa.Boolean(), nullable=False), schema='STG_RASPHYSMSU')
op.add_column('link_new_with_dates', sa.Column('weekday', sa.Integer(), nullable=True), schema='STG_RASPHYSMSU')
op.add_column('link_new_with_dates', sa.Column('num', sa.Integer(), nullable=True), schema='STG_RASPHYSMSU')
op.add_column(
'link_new_with_dates', sa.Column('place', sa.ARRAY(sa.Integer()), nullable=False), schema='STG_RASPHYSMSU'
)
op.add_column(
'link_new_with_dates', sa.Column('group', sa.ARRAY(sa.Integer()), nullable=False), schema='STG_RASPHYSMSU'
)
op.add_column(
'link_new_with_dates', sa.Column('teacher', sa.ARRAY(sa.Integer()), nullable=False), schema='STG_RASPHYSMSU'
)
op.add_column(
'link_new_with_dates', sa.Column('events_id', sa.ARRAY(sa.Integer()), nullable=True), schema='STG_RASPHYSMSU'
)
op.alter_column(
'link_new_with_dates', 'subject', existing_type=sa.VARCHAR(), nullable=False, schema='STG_RASPHYSMSU'
)


def downgrade():
op.alter_column(
'link_new_with_dates', 'subject', existing_type=sa.VARCHAR(), nullable=True, schema='STG_RASPHYSMSU'
)
op.drop_column('link_new_with_dates', 'events_id', schema='STG_RASPHYSMSU')
op.drop_column('link_new_with_dates', 'teacher', schema='STG_RASPHYSMSU')
op.drop_column('link_new_with_dates', 'group', schema='STG_RASPHYSMSU')
op.drop_column('link_new_with_dates', 'place', schema='STG_RASPHYSMSU')
op.drop_column('link_new_with_dates', 'num', schema='STG_RASPHYSMSU')
op.drop_column('link_new_with_dates', 'weekday', schema='STG_RASPHYSMSU')
op.drop_column('link_new_with_dates', 'even', schema='STG_RASPHYSMSU')
op.drop_column('link_new_with_dates', 'odd', schema='STG_RASPHYSMSU')
10 changes: 9 additions & 1 deletion profcomff_definitions/STG/rasphysmsu.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,17 @@ class New(Base):

class LinkNewWithDates(Base):
id: Mapped[int] = mapped_column(primary_key=True)
subject: Mapped[str | None]
subject: Mapped[str]
odd: Mapped[bool]
even: Mapped[bool]
weekday: Mapped[int | None]
num: Mapped[int | None]
start: Mapped[str]
end: Mapped[str]
place: Mapped[tp.List[int]] = mapped_column(ARRAY(Integer))
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))


class NewWithDates(Base):
Expand Down

0 comments on commit 55e350a

Please sign in to comment.