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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,3 +507,4 @@ Repository integration tests are under `tests/integration/` and execute against
- Use Docker/Testcontainers automatically: `npm run test:integration`
- Use an existing DB in CI: `TEST_DATABASE_URL=postgresql://... npm run test:integration`
- Coverage report: `npm run coverage`
dummy
9 changes: 9 additions & 0 deletions src/migrations/004_add_active_subscriptions_partial_index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { MigrationBuilder } from 'node-pg-migrate'

export async function up(pgm: MigrationBuilder): Promise<void> {
pgm.sql("CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_bonds_active_identity ON bonds (identity_address) WHERE status = 'active'; -- Speeds up active subscription lookups per tenant");
}

export async function down(pgm: MigrationBuilder): Promise<void> {
pgm.sql("DROP INDEX CONCURRENTLY IF EXISTS idx_bonds_active_identity;");
}
Loading