db: drop redundant user_id index on email_sends

The composite ix_email_sends_user_kind_sent (user_id, kind, sent_at)
already satisfies leftmost-prefix WHERE user_id=? lookups on both
MariaDB and SQLite, so the standalone per-column index was dead
weight. Drop it before the migration ever lands in prod.
This commit is contained in:
Giorgio Gilestro 2026-05-25 22:55:33 +02:00
parent 454df3ee0f
commit 51efccd3b1
2 changed files with 1 additions and 5 deletions

View file

@ -46,13 +46,9 @@ def upgrade() -> None:
"email_sends",
["user_id", "kind", "sent_at"],
)
op.create_index(
op.f("ix_email_sends_user_id"), "email_sends", ["user_id"],
)
def downgrade() -> None:
op.drop_index(op.f("ix_email_sends_user_id"), table_name="email_sends")
op.drop_index("ix_email_sends_user_kind_sent", table_name="email_sends")
op.drop_table("email_sends")
op.drop_column("users", "digest_tone")