Centralize durable schema migration ownership
This commit is contained in:
parent
cc328237f4
commit
069f3813ae
2 changed files with 354 additions and 350 deletions
|
|
@ -1,13 +1,11 @@
|
|||
//! Durable soft-delete visibility and recoverable exact hard deletion.
|
||||
|
||||
mod error;
|
||||
mod migrate;
|
||||
mod registry;
|
||||
mod service;
|
||||
mod types;
|
||||
|
||||
pub use error::DeletionError;
|
||||
pub use migrate::{migrate, migrator};
|
||||
pub use registry::TargetRegistry;
|
||||
pub use service::DeletionService;
|
||||
pub use types::{
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
use remora_durable::DurableError;
|
||||
use sqlx::PgPool;
|
||||
|
||||
const MIGRATION_TABLE: &str = "_remora_deletion_migrations";
|
||||
|
||||
pub async fn migrate(pool: &PgPool) -> Result<(), DurableError> {
|
||||
let mut migrator = sqlx::migrate!("./migrations");
|
||||
migrator.dangerous_set_table_name(MIGRATION_TABLE);
|
||||
migrator.run(pool).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn migrator() -> sqlx::migrate::Migrator {
|
||||
let mut migrator = sqlx::migrate!("./migrations");
|
||||
migrator.dangerous_set_table_name(MIGRATION_TABLE);
|
||||
migrator
|
||||
}
|
||||
Loading…
Reference in a new issue