From 368cd4541dcdd92c52b8ee7d3cfede8cc20cfbdd Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Thu, 4 Dec 2025 15:13:42 +0100 Subject: [PATCH] Don't error out if a migration is missing This allows us to roll back to older versions of MAS. --- crates/storage-pg/src/lib.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/storage-pg/src/lib.rs b/crates/storage-pg/src/lib.rs index 2aada4975..fa3a885ab 100644 --- a/crates/storage-pg/src/lib.rs +++ b/crates/storage-pg/src/lib.rs @@ -452,8 +452,11 @@ pub async fn pending_migrations( version = applied_migration.version ); } else { - // The migration is missing, and not allowed to be missing - return Err(MigrateError::VersionMissing(applied_migration.version)); + // The migration is missing, warn about it + warn!( + "The database has a migration applied ({version}) that doesn't exist anymore! This should not happen, unless rolling back to an older version of MAS.", + version = applied_migration.version + ); } }