17 lines
510 B
Rust
17 lines
510 B
Rust
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
|
|
}
|