From 28e885f6c7673e404347c7252489f9eed8ea3f3a Mon Sep 17 00:00:00 2001 From: orangecoding Date: Thu, 18 Sep 2025 18:42:19 +0200 Subject: [PATCH] fixing migration checksum --- lib/services/storage/migrations/migrate.js | 24 ++++++---------------- package.json | 2 +- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/lib/services/storage/migrations/migrate.js b/lib/services/storage/migrations/migrate.js index f3bf650..ab7356d 100644 --- a/lib/services/storage/migrations/migrate.js +++ b/lib/services/storage/migrations/migrate.js @@ -127,24 +127,12 @@ export async function runMigrations() { if (executed.has(m.name)) { const prev = executed.get(m.name); if (prev !== checksum) { - const allow = (process.env.MIGRATION_ALLOW_CHECKSUM_UPDATE || '').toLowerCase(); - const allowUpdate = allow === '1' || allow === 'true' || allow === 'yes'; - if (allowUpdate) { - logger.warn( - `Checksum mismatch for already executed migration ${m.name}, but MIGRATION_ALLOW_CHECKSUM_UPDATE is enabled. ` + - `Updating recorded checksum and continuing without re-running the migration.`, - ); - SqliteConnection.execute('UPDATE schema_migrations SET checksum = @checksum WHERE name = @name', { - checksum, - name: m.name, - }); - executed.set(m.name, checksum); - } else { - throw new Error( - `Checksum mismatch for already executed migration ${m.name}. ` + - `Do not modify applied migrations. Create a new migration instead.`, - ); - } + logger.info(`Mismatch found in migration ${m.name}. Fixing.`); + SqliteConnection.execute('UPDATE schema_migrations SET checksum = @checksum WHERE name = @name', { + checksum, + name: m.name, + }); + executed.set(m.name, checksum); } continue; } diff --git a/package.json b/package.json index 1adbfdf..34063c6 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fredy", - "version": "12.0.1", + "version": "12.0.2", "description": "[F]ind [R]eal [E]states [d]amn eas[y].", "scripts": { "prepare": "husky",