"""Drop UserOAuth.user_settings_id

Revision ID: caba9fb1ea5e
Revises: 83bc2ad3ffcc
Create Date: 2025-11-11 16:38:27.243693

"""

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "caba9fb1ea5e"
down_revision = "83bc2ad3ffcc"
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("user_oauth", schema=None) as batch_op:
        batch_op.drop_constraint(
            batch_op.f("fk_user_oauth_user_settings_id_user_settings"),
            type_="foreignkey",
        )
        batch_op.drop_column("user_settings_id")

    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("user_oauth", schema=None) as batch_op:
        batch_op.add_column(
            sa.Column(
                "user_settings_id",
                sa.INTEGER(),
                autoincrement=False,
                nullable=True,
            )
        )
        batch_op.create_foreign_key(
            batch_op.f("fk_user_oauth_user_settings_id_user_settings"),
            "user_settings",
            ["user_settings_id"],
            ["id"],
        )

    # ### end Alembic commands ###
