"""short description

Revision ID: a00f812f2868
Revises: 
Create Date: 2025-08-14 13:32:49.130339
"""

import sqlalchemy as sa
from alembic import op

from sqlalchemy.sql.ddl import CreateSchema, DropSchema

# revision identifiers, used by Alembic.
revision = 'a00f812f2868'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    op.execute(CreateSchema('plugin_custom_profile_fields'))
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('user_custom_profiles',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.Column('country', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['users.users.id'], name=op.f('fk_user_custom_profiles_user_id_users')),
    sa.PrimaryKeyConstraint('id', name=op.f('pk_user_custom_profiles')),
    sa.UniqueConstraint('user_id', name=op.f('uq_user_custom_profiles_user_id')),
    schema='plugin_custom_profile_fields'
    )
    op.create_index(op.f('ix_user_custom_profiles_user_id'), 'user_custom_profiles', ['user_id'], unique=False, schema='plugin_custom_profile_fields')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_user_custom_profiles_user_id'), table_name='user_custom_profiles', schema='plugin_custom_profile_fields')
    op.drop_table('user_custom_profiles', schema='plugin_custom_profile_fields')
    # ### end Alembic commands ###
    op.execute(DropSchema('plugin_custom_profile_fields'))
