"""participant id as string

Revision ID: <KEY>
Revises: 11<PASSWORD>3<PASSWORD>
Create Date: 2022-04-04 04:34:56.202331+00:00

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

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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(
        "applications_participant_id_fkey", "applications", type_="foreignkey"
    )
    op.alter_column(
        "applications",
        "participant_id",
        type_=sqlmodel.sql.sqltypes.AutoString(),
        nullable=False,
    )
    op.alter_column(
        "participants", "id", type_=sqlmodel.sql.sqltypes.AutoString(), nullable=False
    )
    op.create_foreign_key(
        None,
        "applications",
        "participants",
        ["participant_id"],
        ["id"],
        ondelete="CASCADE",
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(
        "applications_participant_id_fkey", "applications", type_="foreignkey"
    )
    op.alter_column(
        "applications", "participant_id", type_=sa.Integer(), nullable=False
    )
    op.alter_column("participants", "id", type_=sa.Integer(), nullable=False)
    op.create_foreign_key(
        None,
        "applications",
        "participants",
        ["participant_id"],
        ["id"],
        ondelete="CASCADE",
    )
    # ### end Alembic commands ###

sqlmodel.sql.sqltypes.AutoString sqlalchemy.Integer alembic.op.drop_constraint alembic.op.create_foreign_key
[((420, 514), 'alembic.op.drop_constraint', 'op.drop_constraint', (['"""applications_participant_id_fkey"""', '"""applications"""'], {'type_': '"""foreignkey"""'}), "('applications_participant_id_fkey', 'applications',\n    type_='foreignkey')\n", (438, 514), False, 'from alembic import op\n'), ((794, 906), 'alembic.op.create_foreign_key', 'op.create_foreign_key', (['None', '"""applications"""', '"""participants"""', "['participant_id']", "['id']"], {'ondelete': '"""CASCADE"""'}), "(None, 'applications', 'participants', [\n    'participant_id'], ['id'], ondelete='CASCADE')\n", (815, 906), False, 'from alembic import op\n'), ((1081, 1175), 'alembic.op.drop_constraint', 'op.drop_constraint', (['"""applications_participant_id_fkey"""', '"""applications"""'], {'type_': '"""foreignkey"""'}), "('applications_participant_id_fkey', 'applications',\n    type_='foreignkey')\n", (1099, 1175), False, 'from alembic import op\n'), ((1372, 1484), 'alembic.op.create_foreign_key', 'op.create_foreign_key', (['None', '"""applications"""', '"""participants"""', "['participant_id']", "['id']"], {'ondelete': '"""CASCADE"""'}), "(None, 'applications', 'participants', [\n    'participant_id'], ['id'], ondelete='CASCADE')\n", (1393, 1484), False, 'from alembic import op\n'), ((610, 644), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (642, 644), False, 'import sqlmodel\n'), ((733, 767), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (765, 767), False, 'import sqlmodel\n'), ((1255, 1267), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (1265, 1267), True, 'import sqlalchemy as sa\n'), ((1338, 1350), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (1348, 1350), True, 'import sqlalchemy as sa\n')]