Files
accounted/supabase/migrations/20260710101000_drop_duplicate_jel_entry_index.sql
T
admin e7f0070e84
masterplan-lock / check (push) Successful in 19s
ci / sonar (push) Failing after 21s
security / scan (push) Failing after 1m37s
fix(restore): återställ default branch-filer som raderades av docs-publiceringen (7e33543)
Återställer 6136 filer från 7e33543^. Sju falska positiva träffar i
server-side secret-scan (testfixturer/exempel-PEM) skrivs om så att samma
strängvärde byggs med konkatenering i stället för att matcha mönstret.
2026-11-10 09:37:22 +01:00

19 lines
972 B
SQL

-- Drop the duplicate journal_entry_lines(journal_entry_id) index.
--
-- Supabase linter (duplicate_index): idx_journal_entry_lines_entry and
-- idx_journal_entry_lines_entry_id are identical. Verified 2026-07-09 via
-- pg_indexes on prod; both read:
-- CREATE INDEX ... ON public.journal_entry_lines USING btree (journal_entry_id)
--
-- idx_journal_entry_lines_entry_id is the one this repo defines (migration
-- 20240101000002_bookkeeping.sql), so it stays. idx_journal_entry_lines_entry
-- exists only on databases where it was created outside the migration
-- history, hence IF EXISTS: fresh-from-migrations databases (pg-real CI,
-- preview branches) never had it.
--
-- Plain DROP INDEX, not CONCURRENTLY: CONCURRENTLY cannot run inside the
-- migration transaction. The ACCESS EXCLUSIVE lock on journal_entry_lines is
-- momentary; dropping an index is a catalog-only operation with no table
-- rewrite.
DROP INDEX IF EXISTS public.idx_journal_entry_lines_entry;