Add index on "user".created_at

Adds migration 119 creating idx_user_created_at on "user"(created_at)
using CREATE INDEX CONCURRENTLY, matching the repo convention for
index-only migrations (114/115).

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
yushen
2026-06-12 15:45:13 +08:00
parent d2a03b8edc
commit cdab78584b
2 changed files with 9 additions and 0 deletions

View File

@@ -0,0 +1 @@
DROP INDEX CONCURRENTLY IF EXISTS idx_user_created_at;

View File

@@ -0,0 +1,8 @@
-- Index on "user".created_at to support ordering/filtering users by signup time.
--
-- "user" is a reserved word so it stays double-quoted. The migration runner
-- executes files outside an explicit transaction, so CONCURRENTLY is kept in
-- its own single-statement migration to avoid Postgres' implicit transaction
-- block for multi-statement query strings.
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_user_created_at
ON "user" (created_at);