Centralize durable schema migration ownership

This commit is contained in:
ms2k 2026-07-19 01:20:18 +09:00
commit 069f3813ae
2 changed files with 354 additions and 350 deletions

View file

@ -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::{

View file

@ -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
}