Skip to content

Commit

Permalink
fix: skip migrating if a record is fully migrated
Browse files Browse the repository at this point in the history
  • Loading branch information
adrians5j committed May 8, 2024
1 parent cdea92b commit a065b88
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/migrations/src/migrations/5.39.6/001/ddb-es/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,15 @@ export class CmsEntriesInitNewMetaFields_5_39_6_001 implements DataMigration {
// Update records in primary DynamoDB table. Also do preparations for
// subsequent updates on DDB-ES DynamoDB table, and in Elasticsearch.
for (const item of result.items) {
const isFullyMigrated =
isMigratedEntry(item) &&
hasValidTypeFieldValue(item) &&
hasAllNonNullableValues(item);

if (isFullyMigrated) {
continue;
}

const index = esGetIndexName({
tenant: item.tenant,
locale: item.locale,
Expand Down

0 comments on commit a065b88

Please sign in to comment.