From 5ba4029d8692b2e6054fca7f45ed4cfded4738ef Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sun, 8 Mar 2026 16:18:22 +0000 Subject: [PATCH] fix: skip down migrations in potentially_stale checksum comparison (#8271) The potentially_stale block iterated over all migrations including .down.sql reversible migrations. Down migrations share the same version as their up counterpart but have a different checksum, causing the DELETE to remove the up migration row on every startup and triggering re-application of the concurrent index migrations. Co-authored-by: Claude Opus 4.6 --- backend/windmill-api/src/db.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/windmill-api/src/db.rs b/backend/windmill-api/src/db.rs index 8b0fb44dfe..c8ed841e19 100644 --- a/backend/windmill-api/src/db.rs +++ b/backend/windmill-api/src/db.rs @@ -284,6 +284,9 @@ pub async fn migrate( 20260207000004, ]; for m in migrator.migrations.iter() { + if m.migration_type.is_down_migration() { + continue; + } if potentially_stale.contains(&m.version) { if let Err(err) = sqlx::query("DELETE FROM _sqlx_migrations WHERE version = $1 AND checksum != $2")