Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
[workspace]

[dependencies]
axum = { version = "0.7.4", features = ["multipart"] }
axum = { version = "0.7.4", features = ["multipart", "ws"] }
tokio = { version = "1.36.0", features = ["full"] }
serde = { version = "1.0.197", features = ["derive"] }
serde_json = "1.0.114"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-- no-transaction
-- #948: Zero-downtime compound index for per-user transaction history
-- (`WHERE user_id = $1 ORDER BY created_at DESC`).
--
-- CREATE INDEX CONCURRENTLY cannot run inside a transaction block, so the
-- `-- no-transaction` directive above (must be the first line; sqlx 0.7
-- syntax) tells SQLx not to wrap this file. Postgres also runs a
-- multi-statement query string as one implicit transaction, so each
-- concurrent index lives in its own migration file.
--
-- If a concurrent build is interrupted it leaves an INVALID index that
-- IF NOT EXISTS will skip; drop it with DROP INDEX CONCURRENTLY and re-run.
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_yield_tx_user_id_created_at
ON yield_transactions (user_id, created_at DESC);
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- no-transaction
-- #948: Zero-downtime compound index for a user's sent-payment history
-- (`WHERE sender_id = $1 ORDER BY created_at DESC`). See
-- 20260924000000_add_yield_transactions_user_created_at_index.sql for why
-- this runs outside a transaction and in its own file.
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_payments_sender_id_created_at
ON payments (sender_id, created_at DESC);
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- no-transaction
-- #948: Zero-downtime compound index for a user's received-payment history
-- (`WHERE receiver_id = $1 ORDER BY created_at DESC`). See
-- 20260924000000_add_yield_transactions_user_created_at_index.sql for why
-- this runs outside a transaction and in its own file.
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_payments_receiver_id_created_at
ON payments (receiver_id, created_at DESC);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- Rollback for 20260924000000_add_yield_transactions_user_created_at_index.sql
-- Run outside a transaction (psql -f does not wrap by default).
DROP INDEX CONCURRENTLY IF EXISTS idx_yield_tx_user_id_created_at;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- Rollback for 20260924000001_add_payments_sender_created_at_index.sql
-- Run outside a transaction (psql -f does not wrap by default).
DROP INDEX CONCURRENTLY IF EXISTS idx_payments_sender_id_created_at;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- Rollback for 20260924000002_add_payments_receiver_created_at_index.sql
-- Run outside a transaction (psql -f does not wrap by default).
DROP INDEX CONCURRENTLY IF EXISTS idx_payments_receiver_id_created_at;
Loading
Loading