Implement recoverable exact result deletion
This commit is contained in:
parent
cdeef3cc1a
commit
791e00f4c0
1 changed files with 2521 additions and 1 deletions
17
crates/remora-deletion/src/migrate.rs
Normal file
17
crates/remora-deletion/src/migrate.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
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