Centralize durable schema migration ownership
This commit is contained in:
parent
cc328237f4
commit
069f3813ae
2 changed files with 354 additions and 350 deletions
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
mod authz;
|
||||
mod error;
|
||||
mod migrate;
|
||||
mod oidc;
|
||||
mod principal;
|
||||
mod roles;
|
||||
|
|
@ -22,7 +21,6 @@ pub use authz::{
|
|||
resource_visibility,
|
||||
};
|
||||
pub use error::IdentityError;
|
||||
pub use migrate::{migrate, migrator};
|
||||
pub use oidc::{OidcConfig, OidcIdentityProvider, ZITADEL_PROJECT_ROLES_CLAIM, roles_from_names};
|
||||
pub use principal::{ExternalIdentity, Principal, principal_id_for};
|
||||
pub use roles::{
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
use remora_durable::DurableError;
|
||||
use sqlx::PgPool;
|
||||
|
||||
/// Separate migration history from the DurableStore substrate so feature-package
|
||||
/// versions do not collide with `remora-durable` in `_sqlx_migrations`.
|
||||
const MIGRATION_TABLE: &str = "_remora_identity_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
|
||||
}
|
||||
Loading…
Reference in a new issue