Centralize durable schema migration ownership
This commit is contained in:
parent
cc328237f4
commit
069f3813ae
2 changed files with 354 additions and 350 deletions
|
|
@ -2,12 +2,10 @@
|
|||
|
||||
mod error;
|
||||
mod inventory;
|
||||
mod migrate;
|
||||
mod types;
|
||||
|
||||
pub use error::ResultError;
|
||||
pub use inventory::ResultInventory;
|
||||
pub use migrate::{migrate, migrator};
|
||||
pub use types::{
|
||||
CommittedResult, MANIFEST_SCHEMA_VERSION, ManifestBuildMetrics, ManifestObjectIdentity,
|
||||
PageSize, PublicationInput, ResultMember, ResultMemberPage,
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
use remora_durable::DurableError;
|
||||
use sqlx::PgPool;
|
||||
|
||||
const MIGRATION_TABLE: &str = "_remora_result_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