"""Add user preferences

Revision ID: 32ebf231693a
Revises: a0b7abe57112
Create Date: 2025-12-02 02:46:02.955217

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
import sqlmodel


# revision identifiers, used by Alembic.
revision: str = '32ebf231693a'
down_revision: Union[str, Sequence[str], None] = 'a0b7abe57112'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('userpreferences',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.Column('wiki_mode', sa.Boolean(), nullable=False),
    sa.Column('show_ratings', sa.Boolean(), nullable=False),
    sa.Column('show_comments', sa.Boolean(), nullable=False),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('user_id')
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('userpreferences')
    # ### end Alembic commands ###
