12 lines
378 B
Rust
12 lines
378 B
Rust
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)))
|
|
}
|