"""Add indexes to EntityModel

Revision ID: 00904ac8c6fc
Revises: 
Create Date: 2024-07-17 12:16:59.911285

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


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


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_index('idx_file_type', 'entities', ['file_type'], unique=False)
    op.create_index('idx_filename', 'entities', ['filename'], unique=False)
    op.create_index('idx_filepath', 'entities', ['filepath'], unique=False)
    op.create_index('idx_folder_id', 'entities', ['folder_id'], unique=False)
    op.create_index('idx_library_id', 'entities', ['library_id'], unique=False)
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('idx_library_id', table_name='entities')
    op.drop_index('idx_folder_id', table_name='entities')
    op.drop_index('idx_filepath', table_name='entities')
    op.drop_index('idx_filename', table_name='entities')
    op.drop_index('idx_file_type', table_name='entities')
    # ### end Alembic commands ###
