Centralize durable schema migration ownership
This commit is contained in:
parent
cc328237f4
commit
069f3813ae
2 changed files with 354 additions and 350 deletions
|
|
@ -1,5 +1,4 @@
|
|||
mod error;
|
||||
mod migrate;
|
||||
mod mutation_types;
|
||||
mod mutations;
|
||||
mod recovery;
|
||||
|
|
@ -8,7 +7,6 @@ mod service;
|
|||
mod types;
|
||||
|
||||
pub use error::AttemptError;
|
||||
pub use migrate::migrate;
|
||||
pub use mutation_types::{
|
||||
AttemptMutationOutcome, CheckpointMultipart, CheckpointProjection, CheckpointRecord,
|
||||
CommittedManifestRecord, CommittedResultRecord, DurableDescriptor, FailureRecord,
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
use sqlx::PgPool;
|
||||
|
||||
use crate::AttemptError;
|
||||
|
||||
pub async fn migrate(pool: &PgPool) -> Result<(), AttemptError> {
|
||||
let mut migrator = sqlx::migrate!("./migrations");
|
||||
migrator.dangerous_set_table_name("_remora_attempt_migrations");
|
||||
migrator
|
||||
.run(pool)
|
||||
.await
|
||||
.map_err(|error| AttemptError::Durable(remora_durable::DurableError::Migrate(error)))
|
||||
}
|
||||
Loading…
Reference in a new issue