Skip to content

Commit

Permalink
fix(migrations): migrations migrate options as overrides instead of d…
Browse files Browse the repository at this point in the history
…efaults
  • Loading branch information
jstarpl committed Feb 12, 2025
1 parent a0fe909 commit dbc3bca
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions meteor/server/migration/1_52_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { CoreSystem, PeripheralDevices, Studios, TriggeredActions } from '../col
import {
convertObjectIntoOverrides,
ObjectOverrideSetOp,
ObjectWithOverrides,
wrapDefaultObject,
} from '@sofie-automation/corelib/dist/settings/objectWithOverrides'
import {
Expand Down Expand Up @@ -268,7 +269,9 @@ export const addSteps = addMigrationSteps('1.52.0', [
//@ts-expect-error settings is typed as Record<string, StudioRouteSet>
const oldSettings = studio.settings

const newSettings = wrapDefaultObject<IStudioSettings>(oldSettings || {})
const newSettings = convertObjectIntoOverrides(
oldSettings || {}
) as unknown as ObjectWithOverrides<IStudioSettings>

await Studios.updateAsync(studio._id, {
$set: {
Expand Down Expand Up @@ -304,7 +307,7 @@ export const addSteps = addMigrationSteps('1.52.0', [
for (const system of systems) {
const oldSystem = system as ICoreSystem as PartialOldICoreSystem

const newSettings = wrapDefaultObject<ICoreSystemSettings>({
const newSettings = convertObjectIntoOverrides({
cron: {
casparCGRestart: {
enabled: false,
Expand All @@ -316,7 +319,7 @@ export const addSteps = addMigrationSteps('1.52.0', [
},
support: oldSystem.support ?? { message: '' },
evaluationsMessage: oldSystem.evaluations ?? { enabled: false, heading: '', message: '' },
})
}) as unknown as ObjectWithOverrides<ICoreSystemSettings>

await CoreSystem.updateAsync(system._id, {
$set: {
Expand Down

0 comments on commit dbc3bca

Please sign in to comment.