@balena/open-balena-api 31.2.1-build-add-service-idx-on-dsev-003ffcd306a3e3b20fc693a6071f0c9bf65f38b2-1 → 31.2.2-build-backfill-service-device-on-dsev-6ef290f340f7b8d0e49e5514f6797ae285cd3042-1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ import type { Migrator } from '@balena/pinejs';
2
+ declare const migration: Migrator.AsyncMigration;
3
+ export default migration;
@@ -0,0 +1,34 @@
1
+ const migration = {
2
+ asyncSql: `\
3
+ UPDATE "device service environment variable" AS dsev
4
+ SET
5
+ "device" = si."device",
6
+ "service" = si."installs-service"
7
+ FROM "service install" AS si
8
+ WHERE dsev."service install" = si."id"
9
+ AND dsev.id IN (
10
+ SELECT id
11
+ FROM "device service environment variable"
12
+ WHERE ( "device" IS NULL OR "service" IS NULL )
13
+ FOR UPDATE SKIP LOCKED
14
+ LIMIT %%ASYNC_BATCH_SIZE%%
15
+ );
16
+ `,
17
+ syncSql: `\
18
+ UPDATE "device service environment variable" AS dsev
19
+ SET
20
+ "device" = si."device",
21
+ "service" = si."installs-service"
22
+ FROM "service install" AS si
23
+ WHERE
24
+ dsev."service install" = si."id"
25
+ AND (dsev."device" IS NULL OR dsev."service" IS NULL);
26
+ `,
27
+ asyncBatchSize: 5000,
28
+ delayMS: 60000,
29
+ backoffDelayMS: 120000,
30
+ errorThreshold: 10,
31
+ finalize: true,
32
+ };
33
+ export default migration;
34
+ //# sourceMappingURL=00097-backfill-device-service-on-device-service-environment-variable.async.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"00097-backfill-device-service-on-device-service-environment-variable.async.js","sourceRoot":"","sources":["../../src/migrations/00097-backfill-device-service-on-device-service-environment-variable.async.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAA4B;IAC1C,QAAQ,EAAE;;;;;;;;;;;;;;EAcT;IACD,OAAO,EAAE;;;;;;;;;EASR;IACD,cAAc,EAAE,IAAI;IACpB,OAAO,EAAE,KAAK;IACd,cAAc,EAAE,MAAM;IACtB,cAAc,EAAE,EAAE;IAClB,QAAQ,EAAE,IAAI;CACd,CAAC;AAEF,eAAe,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@balena/open-balena-api",
3
3
  "description": "Internet of things, Made Simple",
4
- "version": "31.2.1-build-add-service-idx-on-dsev-003ffcd306a3e3b20fc693a6071f0c9bf65f38b2-1",
4
+ "version": "31.2.2-build-backfill-service-device-on-dsev-6ef290f340f7b8d0e49e5514f6797ae285cd3042-1",
5
5
  "license": "AGPL-3.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -166,6 +166,6 @@
166
166
  "loader": "ts-node/esm/transpile-only"
167
167
  },
168
168
  "versionist": {
169
- "publishedAt": "2024-11-18T11:57:01.341Z"
169
+ "publishedAt": "2024-11-18T13:44:45.619Z"
170
170
  }
171
171
  }