Skip to content
Merged
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
14 changes: 14 additions & 0 deletions nexus/catalog/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,20 @@ async fn run_migrations(client: &mut Client) -> anyhow::Result<()> {
migration.version()
);
}
run_non_transactional_migrations(client).await?;
Ok(())
}

async fn run_non_transactional_migrations(client: &Client) -> anyhow::Result<()> {
const STATEMENTS: &[&str] = &[
"CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_cdc_batches_flow_name_batch_id_open ON peerdb_stats.cdc_batches (flow_name, batch_id) WHERE end_time IS NULL",
];
for stmt in STATEMENTS {
client
.batch_execute(stmt)
.await
.with_context(|| format!("Failed to apply non-transactional migration: {stmt}"))?;
}
Ok(())
}

Expand Down
Loading