"""Add schools

Revision ID: 423e059e8b64
Revises: 58d2280520b8
Create Date: 2022-02-12 07:44:42.189067+00:00

"""
import sqlalchemy as sa
import sqlmodel
from alembic import op

# revision identifiers, used by Alembic.
revision = "423e059e8b64"
down_revision = "58d2280520b8"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "schools",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("name", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
        sa.PrimaryKeyConstraint("id"),
    )
    op.add_column("applications", sa.Column("school_id", sa.Integer(), nullable=False))
    op.create_foreign_key(None, "applications", "schools", ["school_id"], ["id"])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, "applications", type_="foreignkey")
    op.drop_column("applications", "school_id")
    op.drop_table("schools")
    # ### end Alembic commands ###

alembic.op.create_foreign_key alembic.op.drop_constraint alembic.op.drop_table alembic.op.drop_column sqlalchemy.PrimaryKeyConstraint sqlalchemy.Integer sqlmodel.sql.sqltypes.AutoString
[((710, 787), 'alembic.op.create_foreign_key', 'op.create_foreign_key', (['None', '"""applications"""', '"""schools"""', "['school_id']", "['id']"], {}), "(None, 'applications', 'schools', ['school_id'], ['id'])\n", (731, 787), False, 'from alembic import op\n'), ((912, 972), 'alembic.op.drop_constraint', 'op.drop_constraint', (['None', '"""applications"""'], {'type_': '"""foreignkey"""'}), "(None, 'applications', type_='foreignkey')\n", (930, 972), False, 'from alembic import op\n'), ((977, 1020), 'alembic.op.drop_column', 'op.drop_column', (['"""applications"""', '"""school_id"""'], {}), "('applications', 'school_id')\n", (991, 1020), False, 'from alembic import op\n'), ((1025, 1049), 'alembic.op.drop_table', 'op.drop_table', (['"""schools"""'], {}), "('schools')\n", (1038, 1049), False, 'from alembic import op\n'), ((581, 610), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""id"""'], {}), "('id')\n", (604, 610), True, 'import sqlalchemy as sa\n'), ((463, 475), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (473, 475), True, 'import sqlalchemy as sa\n'), ((520, 554), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (552, 554), False, 'import sqlmodel\n'), ((675, 687), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (685, 687), True, 'import sqlalchemy as sa\n')]