"""Добавил поля для связи студента и телеграм стейта

Revision ID: <KEY>
Revises: <PASSWORD>
Create Date: 2020-09-12 22:33:58.726338

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    # op.add_column('students', sa.Column('telegram_state_id', sa.Integer(), nullable=True))
    # op.create_foreign_key(None, 'students', 'telegram_states', ['telegram_state_id'], ['id'])
    op.add_column('telegram_states', sa.Column('temp_course_student_id', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'telegram_states', 'students', ['temp_course_student_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'telegram_states', type_='foreignkey')
    op.drop_column('telegram_states', 'temp_course_student_id')
    # op.drop_constraint(None, 'students', type_='foreignkey')
    # op.drop_column('students', 'telegram_state_id')
    # ### end Alembic commands ###

"""Добавил поля для связи студента и телеграм стейта

Revision ID: <KEY>
Revises: <PASSWORD>
Create Date: 2020-09-12 22:33:58.726338

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    # op.add_column('students', sa.Column('telegram_state_id', sa.Integer(), nullable=True))
    # op.create_foreign_key(None, 'students', 'telegram_states', ['telegram_state_id'], ['id'])
    op.add_column('telegram_states', sa.Column('temp_course_student_id', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'telegram_states', 'students', ['temp_course_student_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'telegram_states', type_='foreignkey')
    op.drop_column('telegram_states', 'temp_course_student_id')
    # op.drop_constraint(None, 'students', type_='foreignkey')
    # op.drop_column('students', 'telegram_state_id')
    # ### end Alembic commands ###

Добавил поля для связи студента и телеграм стейта  Revision ID: <KEY> Revises: <PASSWORD> Create Date: 2020-09-12 22:33:58.726338 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # op.add_column('students', sa.Column('telegram_state_id', sa.Integer(), nullable=True)) # op.create_foreign_key(None, 'students', 'telegram_states', ['telegram_state_id'], ['id']) # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # op.drop_constraint(None, 'students', type_='foreignkey') # op.drop_column('students', 'telegram_state_id') # ### end Alembic commands ###