Skip to content

Commit

Permalink
Update apps/civicsignalblog/migrations/20241122_054517_migration.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Clemence Kyara <[email protected]>
  • Loading branch information
m453h and kilemensi authored Nov 22, 2024
1 parent 10b5ae1 commit 5aa13af
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions apps/civicsignalblog/migrations/20241122_054517_migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,8 @@ export async function up({ payload }: MigrateUpArgs): Promise<void> {
}

try {
newGlobalConfig = {
...existingGlobalConfig,
globalType: newGlobalConfigType,
};

delete newGlobalConfig._id;
const { _id, globalType, ...newGlobalConfig } = existingOldConfig;
newGlobalConfig.globalType = newGlobalConfigType;
await db.collection("globals").insertOne(newGlobalConfig);
payload.logger.info(
`✓ Successfully migrated global config [${oldGlobalConfigType}] to [${newGlobalConfigType}]`,
Expand Down

0 comments on commit 5aa13af

Please sign in to comment.