@jskit-ai/database-runtime 0.1.107 → 0.1.109

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  export default Object.freeze({
2
2
  packageVersion: 1,
3
3
  packageId: "@jskit-ai/database-runtime",
4
- version: "0.1.107",
4
+ version: "0.1.109",
5
5
  kind: "runtime",
6
6
  dependsOn: [
7
7
  "@jskit-ai/kernel"
@@ -58,7 +58,7 @@ export default Object.freeze({
58
58
  mutations: {
59
59
  dependencies: {
60
60
  runtime: {
61
- "@jskit-ai/kernel": "0.1.108",
61
+ "@jskit-ai/kernel": "0.1.110",
62
62
  "dotenv": "^16.4.5",
63
63
  "knex": "^3.1.0"
64
64
  },
@@ -66,9 +66,10 @@ export default Object.freeze({
66
66
  },
67
67
  packageJson: {
68
68
  scripts: {
69
- "db:migrate": "knex --knexfile ./knexfile.js migrate:latest",
69
+ "db:migrations:sync": "jskit migrations changed",
70
+ "db:migrate": "npm run db:migrations:sync && knex --knexfile ./knexfile.js migrate:latest",
70
71
  "db:migrate:rollback": "knex --knexfile ./knexfile.js migrate:rollback",
71
- "db:migrate:status": "knex --knexfile ./knexfile.js migrate:list"
72
+ "db:migrate:status": "npm run db:migrations:sync && knex --knexfile ./knexfile.js migrate:list"
72
73
  }
73
74
  },
74
75
  procfile: {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/database-runtime",
3
- "version": "0.1.107",
3
+ "version": "0.1.109",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "node --test"
@@ -25,6 +25,6 @@
25
25
  "./shared/transactions": "./src/shared/transactions.js"
26
26
  },
27
27
  "dependencies": {
28
- "@jskit-ai/kernel": "0.1.108"
28
+ "@jskit-ai/kernel": "0.1.110"
29
29
  }
30
30
  }
@@ -0,0 +1,21 @@
1
+ import assert from "node:assert/strict";
2
+ import test from "node:test";
3
+ import descriptor from "../package.descriptor.mjs";
4
+
5
+ test("database-runtime db migrate scripts sync JSKIT-managed migrations before Knex reads them", () => {
6
+ const scripts = descriptor.mutations.packageJson.scripts;
7
+
8
+ assert.equal(scripts["db:migrations:sync"], "jskit migrations changed");
9
+ assert.equal(
10
+ scripts["db:migrate"],
11
+ "npm run db:migrations:sync && knex --knexfile ./knexfile.js migrate:latest"
12
+ );
13
+ assert.equal(
14
+ scripts["db:migrate:status"],
15
+ "npm run db:migrations:sync && knex --knexfile ./knexfile.js migrate:list"
16
+ );
17
+ assert.equal(
18
+ scripts["db:migrate:rollback"],
19
+ "knex --knexfile ./knexfile.js migrate:rollback"
20
+ );
21
+ });