@balena/pinejs 14.44.0-linear-runtime-migrator-e15bea04e85fb013aeed7d4770052b51747a619c → 15.0.0-delete-state-default-user-permissions-ba0732a0c5d0da9d1d5be818cb08cc898e86ebe3
Sign up to get free protection for your applications and to get access to all the features.
- package/.versionbot/CHANGELOG.yml +24 -45
- package/CHANGELOG.md +8 -6
- package/VERSION +1 -1
- package/docs/Migrations.md +1 -101
- package/out/config-loader/config-loader.d.ts +4 -2
- package/out/config-loader/config-loader.js +20 -35
- package/out/config-loader/config-loader.js.map +1 -1
- package/out/config-loader/env.d.ts +0 -3
- package/out/config-loader/env.js +0 -3
- package/out/config-loader/env.js.map +1 -1
- package/out/migrator/migrations.sbvr +0 -66
- package/out/migrator/migrator.d.ts +17 -0
- package/out/migrator/migrator.js +185 -0
- package/out/migrator/migrator.js.map +1 -0
- package/out/sbvr-api/sbvr-utils.d.ts +1 -3
- package/out/sbvr-api/sbvr-utils.js +4 -13
- package/out/sbvr-api/sbvr-utils.js.map +1 -1
- package/out/server-glue/module.d.ts +2 -2
- package/out/server-glue/module.js +1 -2
- package/out/server-glue/module.js.map +1 -1
- package/package.json +3 -3
- package/src/config-loader/config-loader.ts +26 -73
- package/src/config-loader/env.ts +0 -3
- package/src/migrator/migrations.sbvr +0 -66
- package/src/migrator/migrator.ts +278 -0
- package/src/sbvr-api/sbvr-utils.ts +3 -18
- package/src/server-glue/module.ts +2 -3
- package/out/migrator/async.d.ts +0 -6
- package/out/migrator/async.js +0 -160
- package/out/migrator/async.js.map +0 -1
- package/out/migrator/sync.d.ts +0 -9
- package/out/migrator/sync.js +0 -126
- package/out/migrator/sync.js.map +0 -1
- package/out/migrator/utils.d.ts +0 -56
- package/out/migrator/utils.js +0 -187
- package/out/migrator/utils.js.map +0 -1
- package/src/migrator/async.ts +0 -279
- package/src/migrator/sync.ts +0 -177
- package/src/migrator/utils.ts +0 -296
@@ -1,54 +1,33 @@
|
|
1
1
|
- commits:
|
2
|
-
- subject:
|
3
|
-
|
4
|
-
hash: e15bea04e85fb013aeed7d4770052b51747a619c
|
2
|
+
- subject: Delete default user permissions that are no longer in the config
|
3
|
+
hash: ba0732a0c5d0da9d1d5be818cb08cc898e86ebe3
|
5
4
|
body: ""
|
6
5
|
footer:
|
7
|
-
Change-type:
|
8
|
-
change-type:
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
categories.
|
15
|
-
hash: cda0d148b4e8d5cc923445e44894e39aa4d61be2
|
16
|
-
body: |
|
17
|
-
Add basic test for sync migrator
|
18
|
-
footer:
|
19
|
-
Change-type: minor
|
20
|
-
change-type: minor
|
21
|
-
Signed-off-by: Harald Fischer <harald@balena.io>
|
22
|
-
signed-off-by: Harald Fischer <harald@balena.io>
|
23
|
-
author: Harald Fischer
|
24
|
-
nested: []
|
25
|
-
- subject: Generalisation and decouple migrator functions. Prepare for migration
|
26
|
-
categories.
|
27
|
-
hash: 8256faec5a97b9eb10a158cc07d8e2a00f5c912d
|
28
|
-
body: |
|
29
|
-
Add basic test for sync migrator
|
30
|
-
footer:
|
31
|
-
Change-type: minor
|
32
|
-
change-type: minor
|
33
|
-
Signed-off-by: Harald Fischer <harald@balena.io>
|
34
|
-
signed-off-by: Harald Fischer <harald@balena.io>
|
35
|
-
author: Harald Fischer
|
6
|
+
Change-type: major
|
7
|
+
change-type: major
|
8
|
+
See: https://www.flowdock.com/app/rulemotion/resin-devops/threads/-dlSgJYAMPMNZQ6mpxMlubGKYF6
|
9
|
+
see: https://www.flowdock.com/app/rulemotion/resin-devops/threads/-dlSgJYAMPMNZQ6mpxMlubGKYF6
|
10
|
+
Signed-off-by: Thodoris Greasidis <thodoris@balena.io>
|
11
|
+
signed-off-by: Thodoris Greasidis <thodoris@balena.io>
|
12
|
+
author: Thodoris Greasidis
|
36
13
|
nested: []
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
14
|
+
version: 15.0.0
|
15
|
+
title: "'Delete default user permissions that are no longer in the config'"
|
16
|
+
date: 2022-06-02T15:03:31.535Z
|
17
|
+
- commits:
|
18
|
+
- subject: Update typescript to 4.7
|
19
|
+
hash: 6c25444730ccbb0120468a6ce063be7a7f4610be
|
20
|
+
body: ""
|
42
21
|
footer:
|
43
|
-
Change-type:
|
44
|
-
change-type:
|
45
|
-
Signed-off-by:
|
46
|
-
signed-off-by:
|
47
|
-
author:
|
22
|
+
Change-type: patch
|
23
|
+
change-type: patch
|
24
|
+
Signed-off-by: Thodoris Greasidis <thodoris@balena.io>
|
25
|
+
signed-off-by: Thodoris Greasidis <thodoris@balena.io>
|
26
|
+
author: Thodoris Greasidis
|
48
27
|
nested: []
|
49
|
-
version: 14.
|
50
|
-
title: "'
|
51
|
-
date: 2022-05-
|
28
|
+
version: 14.43.6
|
29
|
+
title: "'Update typescript to 4.7'"
|
30
|
+
date: 2022-05-27T20:31:53.052Z
|
52
31
|
- commits:
|
53
32
|
- subject: Update dependencies
|
54
33
|
hash: b765b0941de329230e4d38bbe2c994491413c3ce
|
package/CHANGELOG.md
CHANGED
@@ -4,13 +4,15 @@ All notable changes to this project will be documented in this file
|
|
4
4
|
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
|
5
5
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
6
6
|
|
7
|
-
#
|
8
|
-
## (2022-
|
7
|
+
# v15.0.0
|
8
|
+
## (2022-06-02)
|
9
9
|
|
10
|
-
*
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
* Delete default user permissions that are no longer in the config [Thodoris Greasidis]
|
11
|
+
|
12
|
+
# v14.43.6
|
13
|
+
## (2022-05-27)
|
14
|
+
|
15
|
+
* Update typescript to 4.7 [Thodoris Greasidis]
|
14
16
|
|
15
17
|
# v14.43.5
|
16
18
|
## (2022-05-20)
|
package/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
15.0.0
|
package/docs/Migrations.md
CHANGED
@@ -46,104 +46,4 @@ Migrations which are Node modules should export a function which will be called
|
|
46
46
|
|
47
47
|
You can execute SQL using `tx.executeSql(query)`, however note that the model for which the migration is running will *not* be available under `sbvrUtils.api`, as it has not executed yet.
|
48
48
|
|
49
|
-
You should return a promise so pinejs can wait for completion/errors.
|
50
|
-
|
51
|
-
|
52
|
-
## Async Migrations
|
53
|
-
|
54
|
-
Migrations that may lock tables for a long time, eg. column renames on large tables, can be run as async migrations.
|
55
|
-
|
56
|
-
Async migrations are executed in small batches within individual transactions and run concurrently while Pine is serving requests. Async migrations are multi-instance safe. They are synchronized between instances via the `migration status` database table and the minimum interval between two migration executions is guaranteed across instances.
|
57
|
-
|
58
|
-
When Pine starts and determines there are multiple async migrations to be run, it starts all migrations concurrently. These migrations however do not run in parallel: only one migration batch is executed at any given time, then another, and so on. Thus, migrations should not depend on the result a previous one.
|
59
|
-
Once an async migration starts, it keeps running forever until the server is shutdown. This is to guarantee that new data inserted or updated at runtime can also be migrated. The status of running migrations can be checked in `migration status` table. The configured execution parameters and the execution metrics are stored and updated after each migration batch completes.
|
60
|
-
|
61
|
-
|
62
|
-
Async migrations are stored in the migrations folder, alongside synchronous migrations. Their file names are significant and must contain the string `.async.` so they are treated as async migrations. They can be pure SQL (with `.sql` extension) or Typescript (with `.ts`/`.js` extensions) files.
|
63
|
-
|
64
|
-
The async migration query must have a `LIMIT` statement to limit the maximum number of affected rows per batch.
|
65
|
-
|
66
|
-
### TS migration file format with SQL query string
|
67
|
-
|
68
|
-
``` javascript
|
69
|
-
export = {
|
70
|
-
sql: `\
|
71
|
-
UPDATE "test"
|
72
|
-
SET "columnC" = "test"."columnA"
|
73
|
-
WHERE id IN ( SELECT id FROM (
|
74
|
-
SELECT id FROM "test"
|
75
|
-
WHERE "test"."columnA" <> "test"."columnC" OR "test"."columnC" IS NULL
|
76
|
-
LIMIT 1
|
77
|
-
|
78
|
-
) tmp
|
79
|
-
);
|
80
|
-
`,
|
81
|
-
delayMS: 100,
|
82
|
-
backoffDelayMS: 4000,
|
83
|
-
errorThreshold: 15,
|
84
|
-
};
|
85
|
-
```
|
86
|
-
|
87
|
-
### TS migration file format with migrator funtion definition
|
88
|
-
|
89
|
-
``` javascript
|
90
|
-
export = {
|
91
|
-
fn: async (tx: any) => {
|
92
|
-
const staticSql = `\
|
93
|
-
UPDATE "test"
|
94
|
-
SET "columnC" = "test"."columnA"
|
95
|
-
WHERE id IN ( SELECT id FROM (
|
96
|
-
SELECT id FROM "test"
|
97
|
-
WHERE "test"."columnA" <> "test"."columnC" OR "test"."columnC" IS NULL
|
98
|
-
LIMIT 1
|
99
|
-
|
100
|
-
) tmp
|
101
|
-
);
|
102
|
-
`;
|
103
|
-
|
104
|
-
return await tx.executeSql(staticSql);
|
105
|
-
},
|
106
|
-
delayMS: 100,
|
107
|
-
backoffDelayMS: 4000,
|
108
|
-
errorThreshold: 15,
|
109
|
-
};
|
110
|
-
```
|
111
|
-
### SQL query file (plain text)
|
112
|
-
|
113
|
-
The default values for interval, backoff and error threshold are:
|
114
|
-
```js
|
115
|
-
{
|
116
|
-
asyncMigrationDefaultDelayMS: 1000,
|
117
|
-
asyncMigrationDefaultBackoffDelayMS: 60000,
|
118
|
-
asyncMigrationDefaultErrorThreshold: 10
|
119
|
-
}
|
120
|
-
```
|
121
|
-
|
122
|
-
Some dummy data setup for explanation:
|
123
|
-
``` sql
|
124
|
-
DROP TABLE IF EXISTS "test";
|
125
|
-
|
126
|
-
CREATE TABLE IF NOT EXISTS "test" (
|
127
|
-
"created at" TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
128
|
-
, "id" BIGINT NOT NULL PRIMARY KEY
|
129
|
-
, "columnA" VARCHAR(255) NOT NULL UNIQUE
|
130
|
-
, "columnB" VARCHAR(255) NOT NULL
|
131
|
-
, "columnC" VARCHAR(255) NULL
|
132
|
-
);
|
133
|
-
|
134
|
-
|
135
|
-
INSERT INTO "test" ("id","columnA", "columnB", "columnC")
|
136
|
-
VALUES (1,'a001','b001',NULL), (2,'a002','b002', NULL), (3,'a003','b003', NULL), (4,'a004','b004', 'dummy');
|
137
|
-
```
|
138
|
-
|
139
|
-
async migration date update query. This query will be executed for 4 times with a default iteration interval of 500ms.
|
140
|
-
``` sql
|
141
|
-
UPDATE "test"
|
142
|
-
SET "columnC" = "test"."columnA"
|
143
|
-
WHERE id IN ( SELECT id FROM (
|
144
|
-
SELECT id FROM "test"
|
145
|
-
WHERE "test"."columnA" <> "test"."columnC" OR "test"."columnC" IS NULL
|
146
|
-
LIMIT 1
|
147
|
-
) tmp
|
148
|
-
);
|
149
|
-
```
|
49
|
+
You should return a promise so pinejs can wait for completion/errors.
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import type * as Express from 'express';
|
2
2
|
import type { AbstractSqlModel } from '@balena/abstract-sql-compiler';
|
3
3
|
import type { Database } from '../database-layer/db';
|
4
|
+
import type { Migration } from '../migrator/migrator';
|
4
5
|
import type { Resolvable } from '../sbvr-api/common-types';
|
5
|
-
import { Migrations } from '../migrator/utils';
|
6
6
|
import * as sbvrUtils from '../sbvr-api/sbvr-utils';
|
7
7
|
export declare type SetupFunction = (app: Express.Application, sbvrUtilsInstance: typeof sbvrUtils, db: Database) => Resolvable<void>;
|
8
8
|
export interface Model {
|
@@ -12,7 +12,9 @@ export interface Model {
|
|
12
12
|
modelText?: string;
|
13
13
|
abstractSql?: AbstractSqlModel;
|
14
14
|
migrationsPath?: string;
|
15
|
-
migrations?:
|
15
|
+
migrations?: {
|
16
|
+
[index: string]: Migration;
|
17
|
+
};
|
16
18
|
initSqlPath?: string;
|
17
19
|
initSql?: string;
|
18
20
|
customServerCode?: string | {
|
@@ -1,7 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.setup = void 0;
|
4
|
-
const utils_1 = require("../migrator/utils");
|
5
4
|
const fs = require("fs");
|
6
5
|
const _ = require("lodash");
|
7
6
|
const path = require("path");
|
@@ -64,13 +63,29 @@ const setup = (app) => {
|
|
64
63
|
password: user.password,
|
65
64
|
});
|
66
65
|
if (user.permissions != null) {
|
67
|
-
await Promise.all(user.permissions.map(async (permissionName) => {
|
66
|
+
const permissionIds = await Promise.all(user.permissions.map(async (permissionName) => {
|
68
67
|
const permissionID = await permissionsCache[permissionName];
|
69
68
|
await getOrCreate(authApiTx, 'user__has__permission', {
|
70
69
|
user: userID,
|
71
70
|
permission: permissionID,
|
72
71
|
});
|
72
|
+
return permissionID;
|
73
73
|
}));
|
74
|
+
if (permissionIds.length > 0) {
|
75
|
+
await authApiTx.delete({
|
76
|
+
resource: 'user__has__permission',
|
77
|
+
options: {
|
78
|
+
$filter: {
|
79
|
+
user: userID,
|
80
|
+
$not: {
|
81
|
+
permission: {
|
82
|
+
$in: permissionIds,
|
83
|
+
},
|
84
|
+
},
|
85
|
+
},
|
86
|
+
},
|
87
|
+
});
|
88
|
+
}
|
74
89
|
}
|
75
90
|
}
|
76
91
|
catch (e) {
|
@@ -167,36 +182,15 @@ const setup = (app) => {
|
|
167
182
|
const fileNames = await fs.promises.readdir(migrationsPath);
|
168
183
|
await Promise.all(fileNames.map(async (filename) => {
|
169
184
|
const filePath = path.join(migrationsPath, filename);
|
170
|
-
const fileNameParts = filename.split('.', 3);
|
171
|
-
const fileExtension = path.extname(filename);
|
172
185
|
const [migrationKey] = filename.split('-', 1);
|
173
|
-
|
174
|
-
if (fileNameParts.length === 3) {
|
175
|
-
if (fileNameParts[1] in utils_1.MigrationCategories) {
|
176
|
-
migrationCategory = fileNameParts[1];
|
177
|
-
}
|
178
|
-
else {
|
179
|
-
console.error(`Unrecognised migration file category ${fileNameParts[1]}, skipping: ${path.extname(filename)}`);
|
180
|
-
return;
|
181
|
-
}
|
182
|
-
}
|
183
|
-
const assignMigrationWithCategory = (newMigrationKey, newMigration) => {
|
184
|
-
const catMigrations = migrations[migrationCategory] || {};
|
185
|
-
if (typeof catMigrations === 'object') {
|
186
|
-
migrations[migrationCategory] = {
|
187
|
-
[newMigrationKey]: newMigration,
|
188
|
-
...catMigrations,
|
189
|
-
};
|
190
|
-
}
|
191
|
-
};
|
192
|
-
switch (fileExtension) {
|
186
|
+
switch (path.extname(filename)) {
|
193
187
|
case '.coffee':
|
194
188
|
case '.ts':
|
195
189
|
case '.js':
|
196
|
-
|
190
|
+
migrations[migrationKey] = nodeRequire(filePath);
|
197
191
|
break;
|
198
192
|
case '.sql':
|
199
|
-
|
193
|
+
migrations[migrationKey] = await fs.promises.readFile(filePath, 'utf8');
|
200
194
|
break;
|
201
195
|
default:
|
202
196
|
console.error(`Unrecognised migration file extension, skipping: ${path.extname(filename)}`);
|
@@ -209,21 +203,12 @@ const setup = (app) => {
|
|
209
203
|
}
|
210
204
|
}));
|
211
205
|
await loadConfig(configObj);
|
212
|
-
runAsyncMigrations(configObj);
|
213
206
|
}
|
214
207
|
catch (err) {
|
215
208
|
console.error('Error loading application config', err, err.stack);
|
216
209
|
process.exit(1);
|
217
210
|
}
|
218
211
|
};
|
219
|
-
const runAsyncMigrations = (data) => {
|
220
|
-
for (const model of data.models) {
|
221
|
-
if (model.migrations != null &&
|
222
|
-
Object.keys(model.migrations).includes(utils_1.MigrationCategories.async)) {
|
223
|
-
sbvrUtils.executeAsyncModelMigration(model);
|
224
|
-
}
|
225
|
-
}
|
226
|
-
};
|
227
212
|
return {
|
228
213
|
loadConfig,
|
229
214
|
loadApplicationConfig,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"config-loader.js","sourceRoot":"","sources":["../../src/config-loader/config-loader.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"config-loader.js","sourceRoot":"","sources":["../../src/config-loader/config-loader.ts"],"names":[],"mappings":";;;AAMA,yBAAyB;AACzB,4BAA4B;AAC5B,6BAA6B;AAE7B,oDAAoD;AAEpD,uDAAuD;AAqCvD,MAAM,WAAW,GAAG,KAAK,EACxB,SAAiC,EACjC,QAAgB,EAChB,YAAuB,EACvB,WAAuB,EACtB,EAAE;IACH,MAAM,MAAM,GAAG,CAAC,MAAM,SAAS,CAAC,GAAG,CAAC;QACnC,QAAQ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AC,WAAW,CAAC,CAAC;oBACnD,KAAK,CAAC,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;iBAChE;YACF,CAAC,CAAC,CACF,CAAC;YACF,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC;SAC5B;QAAC,OAAO,GAAG,EAAE;YACb,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;YAClE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAChB;IACF,CAAC,CAAC;IAEF,OAAO;QACN,UAAU;QACV,qBAAqB;KACrB,CAAC;AACH,CAAC,CAAC;AAhOW,QAAA,KAAK,SAgOhB"}
|
@@ -42,8 +42,5 @@ export declare const db: {
|
|
42
42
|
export declare const migrator: {
|
43
43
|
lockTimeout: number;
|
44
44
|
lockFailDelay: number;
|
45
|
-
asyncMigrationDefaultDelayMS: number;
|
46
|
-
asyncMigrationDefaultBackoffDelayMS: number;
|
47
|
-
asyncMigrationDefaultErrorThreshold: number;
|
48
45
|
};
|
49
46
|
export {};
|
package/out/config-loader/env.js
CHANGED
@@ -73,8 +73,5 @@ exports.db = {
|
|
73
73
|
exports.migrator = {
|
74
74
|
lockTimeout: 5 * 60 * 1000,
|
75
75
|
lockFailDelay: 20 * 1000,
|
76
|
-
asyncMigrationDefaultDelayMS: 1000,
|
77
|
-
asyncMigrationDefaultBackoffDelayMS: 60000,
|
78
|
-
asyncMigrationDefaultErrorThreshold: 10,
|
79
76
|
};
|
80
77
|
//# sourceMappingURL=env.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/config-loader/env.ts"],"names":[],"mappings":";;;AACA,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;AACzD,IAAI,CAAC,CAAC,SAAS,EAAE,E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C,MAAM,IAAI,KAAK,CACd,6CAA6C,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,CACjF,CAAC;KACF;CACD;KAAM;IACN,SAAS,GAAG,KAAK,CAAC;CAClB;AAEY,QAAA,EAAE,GAAG;IACjB,QAAQ,EAAE,EAAE;IACZ,iBAAiB,EAAE,KAA2B;IAC9C,gBAAgB,EAAE,SAA+B;IACjD,YAAY,EAAE,SAA+B;IAC7C,uBAAuB,EAAE,KAA2B;IACpD,SAAS,EAAE,IAA2B;IACtC,eAAe,EAAE,KAAK;IACtB,SAAS;IACT,OAAO,EAAE,QAAQ;IACjB,kBAAkB,EAAE,CAAC;CACrB,CAAC;AAEW,QAAA,QAAQ,GAAG;IACvB,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI;IAE1B,aAAa,EAAE,EAAE,GAAG,IAAI;CACxB,CAAC"}
|
@@ -7,7 +7,6 @@ Term: executed migrations
|
|
7
7
|
Term: lock time
|
8
8
|
Concept Type: Date Time (Type)
|
9
9
|
|
10
|
-
|
11
10
|
Term: migration
|
12
11
|
Reference Scheme: model name
|
13
12
|
Database ID Field: model name
|
@@ -22,68 +21,3 @@ Term: migration lock
|
|
22
21
|
|
23
22
|
Fact Type: migration lock has model name
|
24
23
|
Necessity: each migration lock has exactly one model name
|
25
|
-
|
26
|
-
|
27
|
-
Term: migration key
|
28
|
-
Concept Type: Short Text (Type)
|
29
|
-
Term: start time
|
30
|
-
Concept Type: Date Time (Type)
|
31
|
-
Term: last run time
|
32
|
-
Concept Type: Date Time (Type)
|
33
|
-
Term: run counter
|
34
|
-
Concept Type: Integer (Type)
|
35
|
-
Term: migrated rows
|
36
|
-
Concept Type: Integer (Type)
|
37
|
-
Term: error counter
|
38
|
-
Concept Type: Integer (Type)
|
39
|
-
Term: error threshold
|
40
|
-
Concept Type: Integer (Type)
|
41
|
-
Term: delayMS
|
42
|
-
Concept Type: Integer (Type)
|
43
|
-
Term: backoffDelayMS
|
44
|
-
Concept Type: Integer (Type)
|
45
|
-
Term: converged time
|
46
|
-
Concept Type: Date Time (Type)
|
47
|
-
Term: last error message
|
48
|
-
Concept Type: Text (Type)
|
49
|
-
|
50
|
-
Term: migration status
|
51
|
-
Reference Scheme: migration key
|
52
|
-
Database ID Field: migration key
|
53
|
-
|
54
|
-
Fact Type: migration status has migration key
|
55
|
-
Necessity: each migration status has exactly one migration key
|
56
|
-
|
57
|
-
Fact Type: migration status has start time
|
58
|
-
Necessity: each migration status has at most one start time
|
59
|
-
|
60
|
-
Fact Type: migration status has last run time
|
61
|
-
Necessity: each migration status has at most one last run time
|
62
|
-
|
63
|
-
Fact Type: migration status has run counter
|
64
|
-
Necessity: each migration status has at most one run counter
|
65
|
-
|
66
|
-
Fact Type: migration status has migrated rows
|
67
|
-
Necessity: each migration status has at most one migrated rows
|
68
|
-
|
69
|
-
Fact Type: migration status has error counter
|
70
|
-
Necessity: each migration status has at most one error counter
|
71
|
-
|
72
|
-
Fact Type: migration status has error threshold
|
73
|
-
Necessity: each migration status has at most one error threshold
|
74
|
-
|
75
|
-
Fact Type: migration status has delayMS
|
76
|
-
Necessity: each migration status has at most one delayMS
|
77
|
-
|
78
|
-
Fact Type: migration status has backoffDelayMS
|
79
|
-
Necessity: each migration status has at most one backoffDelayMS
|
80
|
-
|
81
|
-
Fact Type: migration status is backoff
|
82
|
-
|
83
|
-
Fact Type: migration status has converged time
|
84
|
-
Necessity: each migration status has at most one converged time
|
85
|
-
|
86
|
-
Fact Type: migration status has last error message
|
87
|
-
Necessity: each migration status has at most one last error message
|
88
|
-
|
89
|
-
Fact Type: migration status should stop
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import type { Tx } from '../database-layer/db';
|
2
|
+
import type { Resolvable } from '../sbvr-api/common-types';
|
3
|
+
import type { Config, Model } from '../config-loader/config-loader';
|
4
|
+
import { TypedError } from 'typed-error';
|
5
|
+
import * as sbvrUtils from '../sbvr-api/sbvr-utils';
|
6
|
+
declare type ApiRootModel = Model & {
|
7
|
+
apiRoot: string;
|
8
|
+
};
|
9
|
+
declare type SbvrUtils = typeof sbvrUtils;
|
10
|
+
export declare type MigrationFn = (tx: Tx, sbvrUtils: SbvrUtils) => Resolvable<void>;
|
11
|
+
export declare type Migration = string | MigrationFn;
|
12
|
+
export declare class MigrationError extends TypedError {
|
13
|
+
}
|
14
|
+
export declare const postRun: (tx: Tx, model: ApiRootModel) => Promise<void>;
|
15
|
+
export declare const run: (tx: Tx, model: ApiRootModel) => Promise<void>;
|
16
|
+
export declare const config: Config;
|
17
|
+
export {};
|