"""adding invitation table

Revision ID: 657ab5c4f6f7
Revises: 488d70ce5beb
Create Date: 2024-08-01 15:14:58.653622

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '657ab5c4f6f7'
down_revision = '488d70ce5beb'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('invitation',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('company_id', sa.Integer(), nullable=True),
    sa.Column('email', sa.String(length=120), nullable=False),
    sa.Column('first_name', sa.String(length=64), nullable=True),
    sa.Column('last_name', sa.String(length=64), nullable=True),
    sa.Column('role', sa.String(length=50), nullable=False),
    sa.Column('token', sa.String(length=128), nullable=False),
    sa.Column('status', sa.String(length=50), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['company_id'], ['company.id'], name=op.f('fk_invitation_company_id_company')),
    sa.PrimaryKeyConstraint('id', name=op.f('pk_invitation')),
    sa.UniqueConstraint('email', name=op.f('uq_invitation_email'))
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('invitation')
    # ### end Alembic commands ###
