"""Add code to Tenant

Revision ID: cab899dbb213
Revises: 98adf66ce189
Create Date: 2025-04-02 16:08:06.597183

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'cab899dbb213'
down_revision = '98adf66ce189'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('tenant', schema=None) as batch_op:
        batch_op.add_column(sa.Column('code', sa.String(length=50), nullable=True))
        batch_op.create_unique_constraint(None, ['code'])

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('tenant', schema=None) as batch_op:
        batch_op.drop_constraint(None, type_='unique')
        batch_op.drop_column('code')

    # ### end Alembic commands ###
