feat: harden community production foundation through story 1.5

This commit is contained in:
bsodfather committed 2026-08-14 00:21:59 +03:00
1 parent c30461cc92
commit f6fc2e5c9b
161 files changed
+16758 -2515

No files matched your search

@@ -5,7 +5,7 @@ use sqlx::{
postgres::{PgConnectOptions, PgPoolOptions},
};
use crate::{error::RegistryError, migrations};
use crate::{MigrationAuthority, error::RegistryError};
use super::{PostgresPoolConfig, PostgresRegistry};
@@ -33,7 +33,7 @@ impl PostgresRegistry {
.max_lifetime(Duration::from_millis(pool_config.max_lifetime_ms))
.connect_with(connect_options)
.await?;
migrations::apply_postgres(&pool).await?;
MigrationAuthority::require_current(&pool).await?;
Ok(Self { pool })
}
@@ -46,11 +46,6 @@ impl PostgresRegistry {
Ok(())
}
pub async fn migrate(&self) -> Result<(), RegistryError> {
migrations::apply_postgres(&self.pool).await?;
Ok(())
}
async fn connect_in_schema(
database_url: &str,
schema: Option<&str>,
@@ -69,7 +64,7 @@ impl PostgresRegistry {
}
let registry = Self { pool };
registry.migrate().await?;
MigrationAuthority::require_current(&registry.pool).await?;
Ok(registry)
}
}