Centralize durable schema migration ownership
This commit is contained in:
parent
cc328237f4
commit
069f3813ae
2 changed files with 354 additions and 350 deletions
|
|
@ -1,15 +1,13 @@
|
|||
//! PostgreSQL DurableStore substrate.
|
||||
//!
|
||||
//! Provides the pool, migration runner, transaction helpers, generic mutation
|
||||
//! ledger refining `RemoraApiMutation`, durable outbox claim/projection, and
|
||||
//! integrity-protected keyset cursor primitives. Feature packages own their
|
||||
//! domain schema additions.
|
||||
//! Provides the pool, transaction helpers, generic mutation ledger refining
|
||||
//! `RemoraApiMutation`, durable outbox claim/projection, and integrity-protected
|
||||
//! keyset cursor primitives.
|
||||
|
||||
mod cas;
|
||||
mod cursor;
|
||||
mod error;
|
||||
mod ledger;
|
||||
mod migrate;
|
||||
mod outbox;
|
||||
mod pool;
|
||||
mod tx;
|
||||
|
|
@ -21,7 +19,6 @@ pub use ledger::{
|
|||
MutationDisposition, MutationOutcome, MutationStatus, execute_mutation, execute_mutation_in_tx,
|
||||
observe_mutation,
|
||||
};
|
||||
pub use migrate::{migrate, migrator};
|
||||
pub use outbox::{
|
||||
OutboxClaim, OutboxClaimFilter, OutboxMessage, claim_batch, claim_batch_in_tx, enqueue,
|
||||
enqueue_after, mark_projected, mark_projected_pool, release_with_error, unprojected_count,
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
use sqlx::PgPool;
|
||||
|
||||
use crate::error::DurableError;
|
||||
|
||||
static MIGRATOR: sqlx::migrate::Migrator = sqlx::migrate!("./migrations");
|
||||
|
||||
pub async fn migrate(pool: &PgPool) -> Result<(), DurableError> {
|
||||
MIGRATOR.run(pool).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn migrator() -> &'static sqlx::migrate::Migrator {
|
||||
&MIGRATOR
|
||||
}
|
||||
Loading…
Reference in a new issue