@balena/open-balena-api 31.2.0-build-add-device-service-fks-099fc98b58a58421f66c5a2ce2b7323a17abe6db-1 → 31.2.1-build-backfill-service-device-on-dsev-3290255fe221136744ba516983a8cb4cf182cef6-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=00096-backfill-device-service-on-device-service-environment-variable.async.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"00096-backfill-device-service-on-device-service-environment-variable.async.js","sourceRoot":"","sources":["../../src/migrations/00096-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.0-build-add-device-service-fks-099fc98b58a58421f66c5a2ce2b7323a17abe6db-1",
4
+ "version": "31.2.1-build-backfill-service-device-on-dsev-3290255fe221136744ba516983a8cb4cf182cef6-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-13T16:54:56.221Z"
169
+ "publishedAt": "2024-11-18T10:56:21.019Z"
170
170
  }
171
171
  }