The index may not exist if migration 017 partially failed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
34 lines
721 B
Python
34 lines
721 B
Python
"""Extend due lookup index to include snoozed_until
|
|
|
|
Revision ID: 018
|
|
Revises: 017
|
|
Create Date: 2026-02-24
|
|
|
|
"""
|
|
from alembic import op
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = "018"
|
|
down_revision = "017"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.execute("DROP INDEX IF EXISTS ix_reminders_due_lookup")
|
|
op.create_index(
|
|
"ix_reminders_due_lookup",
|
|
"reminders",
|
|
["is_active", "is_dismissed", "remind_at", "snoozed_until"],
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.execute("DROP INDEX IF EXISTS ix_reminders_due_lookup")
|
|
op.create_index(
|
|
"ix_reminders_due_lookup",
|
|
"reminders",
|
|
["is_active", "is_dismissed", "remind_at"],
|
|
)
|