diff --git a/db/migrations/20231123030000_add_amount_to_transaction_entries_index.up.sql b/db/migrations/20231123030000_add_amount_to_transaction_entries_index.up.sql new file mode 100644 index 00000000..d6a0aa3b --- /dev/null +++ b/db/migrations/20231123030000_add_amount_to_transaction_entries_index.up.sql @@ -0,0 +1,18 @@ +CREATE INDEX CONCURRENTLY IF NOT EXISTS index_transaction_entries_on_credit_account_id_include_amount + ON public.transaction_entries USING btree + (credit_account_id ASC) + INCLUDE + (amount); + +--bun:split + +CREATE INDEX CONCURRENTLY IF NOT EXISTS index_transaction_entries_on_debit_account_id_include_amount + ON public.transaction_entries USING btree + (debit_account_id ASC) + INCLUDE + (amount); + +--bun:split + +DROP INDEX IF EXISTS index_transaction_entries_on_debit_account_id; +DROP INDEX IF EXISTS index_transaction_entries_on_credit_account_id; \ No newline at end of file