Add crash-safe attempt authority lifecycle
This commit is contained in:
parent
e13c01441c
commit
2db0e22232
1 changed files with 1861 additions and 1 deletions
12
crates/remora-attempt/src/migrate.rs
Normal file
12
crates/remora-attempt/src/migrate.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
use sqlx::PgPool;
|
||||
|
||||
use crate::AttemptError;
|
||||
|
||||
pub async fn migrate(pool: &PgPool) -> Result<(), AttemptError> {
|
||||
let mut migrator = sqlx::migrate!("./migrations");
|
||||
migrator.dangerous_set_table_name("_remora_attempt_migrations");
|
||||
migrator
|
||||
.run(pool)
|
||||
.await
|
||||
.map_err(|error| AttemptError::Durable(remora_durable::DurableError::Migrate(error)))
|
||||
}
|
||||
Loading…
Reference in a new issue