"""add performance indexes

Revision ID: 0c05b22194f3
Revises: 1b0ab951adca
Create Date: 2025-09-12 16:03:33.551737

"""

from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils


# revision identifiers, used by Alembic.
revision = "0c05b22194f3"
down_revision = "1b0ab951adca"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("entity", schema=None) as batch_op:
        batch_op.create_index(
            "ix_entity_entity_type_parent",
            ["entity_type_id", "parent_id"],
            unique=False,
        )
        batch_op.create_index(
            "ix_entity_entity_type_project",
            ["entity_type_id", "project_id"],
            unique=False,
        )

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("entity", schema=None) as batch_op:
        batch_op.drop_index("ix_entity_entity_type_project")
        batch_op.drop_index("ix_entity_entity_type_parent")

    # ### end Alembic commands ###
