From 1405deaf664cee4fb623b732545ebf8aeb5c7a72 Mon Sep 17 00:00:00 2001 From: Adrian Pilarczyk Date: Wed, 28 Jun 2023 09:58:31 +0200 Subject: [PATCH] chore: :card_file_box: modify migration scripts to overwrite (#681) --- .../tax-channels-migration-v1-to-v2.ts | 14 ++++++++------ .../tax-providers-migration-v1-to-v2.ts | 17 +++++++++-------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/apps/taxes/scripts/migrations/tax-channels-migration-v1-to-v2.ts b/apps/taxes/scripts/migrations/tax-channels-migration-v1-to-v2.ts index eddcf7b..adc229d 100644 --- a/apps/taxes/scripts/migrations/tax-channels-migration-v1-to-v2.ts +++ b/apps/taxes/scripts/migrations/tax-channels-migration-v1-to-v2.ts @@ -27,12 +27,14 @@ export class TaxChannelsV1toV2MigrationManager { this.saleorApiUrl ); - const currentConfig = await taxChannelsManagerV2.getConfig(); - - if (currentConfig) { - this.logger.info("Migration is not necessary, we have current config."); - return currentConfig; - } + /* + * Commenting this out, because we want to overwrite the previous migrations. + * const currentConfig = await taxChannelsManagerV2.getConfig(); + * if (currentConfig) { + * this.logger.info("Migration is not necessary, we have current config."); + * return currentConfig; + * } + */ const previousChannelConfig = await taxChannelsManagerV1.getConfig(); diff --git a/apps/taxes/scripts/migrations/tax-providers-migration-v1-to-v2.ts b/apps/taxes/scripts/migrations/tax-providers-migration-v1-to-v2.ts index 8d1abd1..138f721 100644 --- a/apps/taxes/scripts/migrations/tax-providers-migration-v1-to-v2.ts +++ b/apps/taxes/scripts/migrations/tax-providers-migration-v1-to-v2.ts @@ -32,14 +32,15 @@ export class TaxProvidersV1toV2MigrationManager { this.saleorApiUrl ); - const currentTaxProvidersConfig = await taxProvidersManagerV2.getConfig(); - - if (currentTaxProvidersConfig) { - this.logger.info("Migration is not necessary, the config is up to date."); - return; - } - - this.logger.info("Current config not found."); + /* + * Commenting this out, because we want to overwrite the previous migrations. + * const currentTaxProvidersConfig = await taxProvidersManagerV2.getConfig(); + * if (currentTaxProvidersConfig) { + * this.logger.info("Migration is not necessary, the config is up to date."); + * return; + * } + * this.logger.info("Current config not found."); + */ const previousTaxProvidersConfig = await taxProvidersManagerV1.getConfig(); const previousChannelConfig = await taxChannelsManagerV1.getConfig();