a3s_flow/store/
postgres_schema.rs1use a3s_orm::{MigrationReport, Migrator, PostgresExecutor};
2
3use crate::error::{FlowError, Result};
4
5use super::postgres_migrations;
6
7pub async fn migrate_postgres_flow(executor: &PostgresExecutor) -> Result<MigrationReport> {
14 Migrator::new(executor.clone())
15 .run(postgres_migrations())
16 .await
17 .map_err(|error| FlowError::Store(format!("PostgreSQL Flow migration failed: {error}")))
18}
19
20pub(crate) async fn verify_postgres_flow(executor: &PostgresExecutor) -> Result<()> {
21 Migrator::new(executor.clone())
22 .verify_required(postgres_migrations())
23 .await
24 .map_err(|error| {
25 FlowError::Store(format!(
26 "PostgreSQL Flow schema admission failed: {error}; run migrate_postgres_flow before serving"
27 ))
28 })
29}