"""Move default language to Tenant Make

Revision ID: bb67d16f428a
Revises: e47dc002b678
Create Date: 2025-06-27 06:38:35.092499

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = 'bb67d16f428a'
down_revision = 'e47dc002b678'
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.drop_column('allowed_languages')
        batch_op.drop_column('default_language')

    with op.batch_alter_table('tenant_make', schema=None) as batch_op:
        batch_op.add_column(sa.Column('default_language', sa.String(length=2), nullable=True))

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('tenant_make', schema=None) as batch_op:
        batch_op.drop_column('default_language')

    with op.batch_alter_table('tenant', schema=None) as batch_op:
        batch_op.add_column(sa.Column('default_language', sa.VARCHAR(length=2), autoincrement=False, nullable=True))
        batch_op.add_column(sa.Column('allowed_languages', postgresql.ARRAY(sa.VARCHAR(length=2)), autoincrement=False, nullable=True))

    # ### end Alembic commands ###
