make version missing not critical for backward compatibility

This commit is contained in:
Ruben Fiszel
2023-08-10 10:30:32 +02:00
parent 8bb8a361e6
commit 74d9cddceb

View File

@@ -16,6 +16,10 @@ pub type DB = Pool<Postgres>;
pub async fn migrate(db: &DB) -> Result<(), Error> {
match sqlx::migrate!("../migrations").run(db).await {
Ok(_) => Ok(()),
Err(sqlx::migrate::MigrateError::VersionMissing(e)) => {
tracing::error!("Database had been applied more migrations than this container. Please update the container to latest. Not critical, but may cause issues if migration introduced a breaking change. Version missing: {e}");
Ok(())
}
Err(err) => Err(err),
}?;