"""Remove white_label fields from sync table

Revision ID: 63360ed39480
Revises: a40588dab15f
Create Date: 2025-05-18 17:59:02.740577

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '63360ed39480'
down_revision = 'a40588dab15f'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint('uq_white_label_user', 'sync', type_='unique')
    op.drop_constraint('sync_white_label_id_fkey', 'sync', type_='foreignkey')
    op.drop_column('sync', 'white_label_id')
    op.drop_column('sync', 'white_label_user_identifier')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('sync', sa.Column('white_label_user_identifier', sa.VARCHAR(length=256), autoincrement=False, nullable=True))
    op.add_column('sync', sa.Column('white_label_id', sa.UUID(), autoincrement=False, nullable=True))
    op.create_foreign_key('sync_white_label_id_fkey', 'sync', 'white_label', ['white_label_id'], ['id'], ondelete='CASCADE')
    op.create_unique_constraint('uq_white_label_user', 'sync', ['white_label_id', 'white_label_user_identifier'])
    # ### end Alembic commands ###
