From ded920f7f223f29ef1f7e9c9bd0b6c89df3604a4 Mon Sep 17 00:00:00 2001 From: Adrian Smijulj Date: Fri, 28 Jun 2024 08:03:11 +0200 Subject: [PATCH] fix: add support for WEBINY_MIGRATION_FORCE_EXECUTE_5_39_6_001 env var --- .../5.39.6/001/ddb-es/MetaFieldsMigration.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/migrations/src/migrations/5.39.6/001/ddb-es/MetaFieldsMigration.ts b/packages/migrations/src/migrations/5.39.6/001/ddb-es/MetaFieldsMigration.ts index 79faf5f4a9a..bb6fcf8366b 100644 --- a/packages/migrations/src/migrations/5.39.6/001/ddb-es/MetaFieldsMigration.ts +++ b/packages/migrations/src/migrations/5.39.6/001/ddb-es/MetaFieldsMigration.ts @@ -71,8 +71,16 @@ export class MetaFieldsMigration { }); if (dataMigrationRecordExists) { - this.logger.info("5.39.6-001 migration has already been executed. Exiting..."); - return; + const forceExecuteEnvVar = process.env["WEBINY_MIGRATION_FORCE_EXECUTE_5_39_6_001"]; + const forceExecute = forceExecuteEnvVar === "true"; + if (!forceExecute) { + this.logger.info("5.39.6-001 migration has already been executed. Exiting..."); + return; + } + + this.logger.info( + "5.39.6-001 migration has already been executed, but force execution was requested." + ); } this.logger.info("Starting 5.39.6-001 meta fields data migration...");