"""add swag tiers

Revision ID: <KEY>
Revises: 02338256c6aa
Create Date: 2022-06-01 05:58:25.373228+00:00

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

# revision identifiers, used by Alembic.
revision = "<KEY>"
down_revision = "02338256c6aa"
branch_labels = None
depends_on = None


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


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

sqlmodel.sql.sqltypes.AutoString alembic.op.create_foreign_key sqlalchemy.Integer alembic.op.drop_table sqlalchemy.PrimaryKeyConstraint alembic.op.drop_constraint alembic.op.drop_column
[((876, 963), 'alembic.op.create_foreign_key', 'op.create_foreign_key', (['None', '"""participants"""', '"""swag_tiers"""', "['swag_tier_id']", "['id']"], {}), "(None, 'participants', 'swag_tiers', ['swag_tier_id'],\n    ['id'])\n", (897, 963), False, 'from alembic import op\n'), ((1084, 1144), 'alembic.op.drop_constraint', 'op.drop_constraint', (['None', '"""participants"""'], {'type_': '"""foreignkey"""'}), "(None, 'participants', type_='foreignkey')\n", (1102, 1144), False, 'from alembic import op\n'), ((1149, 1195), 'alembic.op.drop_column', 'op.drop_column', (['"""participants"""', '"""swag_tier_id"""'], {}), "('participants', 'swag_tier_id')\n", (1163, 1195), False, 'from alembic import op\n'), ((1200, 1227), 'alembic.op.drop_table', 'op.drop_table', (['"""swag_tiers"""'], {}), "('swag_tiers')\n", (1213, 1227), False, 'from alembic import op\n'), ((731, 760), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""id"""'], {}), "('id')\n", (754, 760), True, 'import sqlalchemy as sa\n'), ((457, 491), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (489, 491), False, 'import sqlmodel\n'), ((543, 577), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (575, 577), False, 'import sqlmodel\n'), ((637, 649), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (647, 649), True, 'import sqlalchemy as sa\n'), ((692, 704), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (702, 704), True, 'import sqlalchemy as sa\n'), ((837, 849), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (847, 849), True, 'import sqlalchemy as sa\n')]