diff --git a/src/balena-init.sql b/src/balena-init.sql index 059d682e0..c58a60df1 100644 --- a/src/balena-init.sql +++ b/src/balena-init.sql @@ -63,10 +63,6 @@ CREATE INDEX IF NOT EXISTS "device_device_type_idx" ON "device" ("is of-device type"); CREATE INDEX IF NOT EXISTS "device_is_running_release_idx" ON "device" ("is running-release"); --- Also optimizes should be running successful release rule --- TODO: remove device_should_be_running_release_application_idx as soon as the is_pinned_on_release migration is ended -CREATE INDEX IF NOT EXISTS "device_should_be_running_release_application_idx" -ON "device" ("should be running-release", "belongs to-application"); -- Also optimizes is pinned on successful release rule CREATE INDEX IF NOT EXISTS "device_is_pinned_on_release_application_idx" ON "device" ("is pinned on-release", "belongs to-application"); diff --git a/src/balena-model.ts b/src/balena-model.ts index fc4745e73..8cdb6f309 100644 --- a/src/balena-model.ts +++ b/src/balena-model.ts @@ -730,11 +730,6 @@ export interface Device { | [ServiceInstance['Read']] | [] | null; - should_be_running__release: - | { __id: Release['Read']['id'] } - | [Release['Read']] - | [] - | null; is_pinned_on__release: | { __id: Release['Read']['id'] } | [Release['Read']] @@ -811,7 +806,6 @@ export interface Device { api_port: Types['Integer']['Write'] | null; api_secret: Types['Short Text']['Write'] | null; is_managed_by__service_instance: ServiceInstance['Write']['id'] | null; - should_be_running__release: Release['Write']['id'] | null; is_pinned_on__release: Release['Write']['id'] | null; should_be_operated_by__release: Release['Write']['id'] | null; should_be_managed_by__release: Release['Write']['id'] | null; @@ -1019,7 +1013,6 @@ export interface Release { release_image?: Array; contains__image?: Array; should_be_running_on__application?: Array; - should_be_running_on__device?: Array; is_running_on__device?: Array; is_pinned_to__device?: Array; should_operate__device?: Array; diff --git a/src/balena.sbvr b/src/balena.sbvr index f4b4b1a6c..0c09eb5a2 100644 --- a/src/balena.sbvr +++ b/src/balena.sbvr @@ -578,9 +578,6 @@ Fact type: device has api secret Fact type: device is managed by service instance Synonymous Form: service instance manages device Necessity: each device is managed by at most one service instance -Fact type: device should be running release - Synonymous Form: release should be running on device - Necessity: each device should be running at most one release Fact type: device is pinned on release Synonymous Form: release is pinned to device Necessity: each device is pinned on at most one release diff --git a/src/features/devices/hooks/defaults-validation.ts b/src/features/devices/hooks/defaults-validation.ts index 879df10ad..5fa7c6eb8 100644 --- a/src/features/devices/hooks/defaults-validation.ts +++ b/src/features/devices/hooks/defaults-validation.ts @@ -29,16 +29,6 @@ hooks.addPureHook('POST', 'resin', 'device', { 'Device UUID must be a 32 or 62 character long lower case hex string.', ); } - - // TODO[device management next step]: Drop this after re-migrating all data on step 2: - if (request.values.is_pinned_on__release !== undefined) { - // Add an async boundary so that value updates, - // and doesn't remove the properties that we add. - // eslint-disable-next-line @typescript-eslint/await-thenable - await null; - request.values.should_be_running__release = - request.values.is_pinned_on__release; - } }, }); @@ -83,15 +73,5 @@ hooks.addPureHook('PATCH', 'resin', 'device', { if (request.values.is_online != null) { request.values.last_connectivity_event = new Date(); } - - // TODO[device management next step]: Drop this after re-migrating all data on step 2: - if (request.values.is_pinned_on__release !== undefined) { - // Add an async boundary so that value updates, - // and doesn't remove the properties that we add. - // eslint-disable-next-line @typescript-eslint/await-thenable - await null; - request.values.should_be_running__release = - request.values.is_pinned_on__release; - } }, });