Skip to main content

migrate_leased

Function migrate_leased 

Source
pub async fn migrate_leased(
    url: &str,
    query_timeout: Duration,
    __arg2: (Duration, bool),
    change_notifications: bool,
) -> Result<(), AppError>
Expand description

schedr db migrate: migrates the database at url holding the master’s lease, so no master runs on the schema meanwhile and no other migration runs at once (sqlx’s own lock is a session lock, which a pooler in transaction mode doesn’t keep). Refused while a master holds it, unless wait.

§Errors

AppError::BadArgument when a master holds the lease (and not wait), else as migrate_holding.