"""Add indexes to membership

Revision ID: c39ad50b46a9
Revises: fbc309cb247f
Create Date: 2025-08-22 20:05:49.187105

"""

from collections.abc import Sequence

from alembic import op

# revision identifiers, used by Alembic.
revision: str = "c39ad50b46a9"
down_revision: str | None = "fbc309cb247f"
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_index(
        "ix_membership_workspace_id", "membership", ["workspace_id"], unique=False
    )
    op.create_index(
        "ix_membership_workspace_user",
        "membership",
        ["workspace_id", "user_id"],
        unique=False,
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index("ix_membership_workspace_user", table_name="membership")
    op.drop_index("ix_membership_workspace_id", table_name="membership")
    # ### end Alembic commands ###
