"""v1-contact-invitation-key

Revision ID: <KEY>
Revises: e40469d1045a
Create Date: 2022-05-11 15:23:29.495804

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

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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "contact",
        sa.Column("invitation_key", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
    )
    op.execute("UPDATE contact SET invitation_key = 'v0'")
    op.alter_column("contact", "invitation_key", nullable=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("contact", "invitation_key")
    # ### end Alembic commands ###

alembic.op.drop_column alembic.op.alter_column alembic.op.execute sqlmodel.sql.sqltypes.AutoString
[((529, 583), 'alembic.op.execute', 'op.execute', (['"""UPDATE contact SET invitation_key = \'v0\'"""'], {}), '("UPDATE contact SET invitation_key = \'v0\'")\n', (539, 583), False, 'from alembic import op\n'), ((588, 648), 'alembic.op.alter_column', 'op.alter_column', (['"""contact"""', '"""invitation_key"""'], {'nullable': '(False)'}), "('contact', 'invitation_key', nullable=False)\n", (603, 648), False, 'from alembic import op\n'), ((773, 816), 'alembic.op.drop_column', 'op.drop_column', (['"""contact"""', '"""invitation_key"""'], {}), "('contact', 'invitation_key')\n", (787, 816), False, 'from alembic import op\n'), ((467, 501), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (499, 501), False, 'import sqlmodel\n')]