"""index_userId

Peek Plugin Database Migration Script

Revision ID: 6896549f8918
Revises: 7e6bd0411082
Create Date: 2024-02-26 16:38:03.869873

"""

# revision identifiers, used by Alembic.
revision = "6896549f8918"
down_revision = "7e6bd0411082"
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa
import geoalchemy2


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    for tableName in ("Task", "Activity"):
        op.create_index(
            index_name=f"idx_{tableName}_userId",
            table_name=tableName,
            columns=["userId"],
            unique=False,
            schema="pl_inbox",
        )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    for tableName in ("Task", "Activity"):
        op.drop_index(
            f"idx_{tableName}_userId", table_name=tableName, schema="pl_inbox"
        )

    # ### end Alembic commands ###
