@jskit-ai/console-core 0.2.54 → 0.2.56

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - `console_core_generic_initial-collation`, a migration Knex runs just before `console_core_generic_initial` (run `npm run db:migrate`): on MySQL and MariaDB it creates `console_settings`, where it does not exist yet, in the collation of the existing tables (`console_settings`, then `users`, then `auth_local_users`) rather than the database's default, and converts it when recorded in another collation and no character can be lost. It changes nothing where it matches.
5
6
  - console_settings declares its foreign key, owner_user_id to users (`foreignKeys`), so json-rest-api 3.1.0 can skip the visibility query a system-context read makes for a record such a key guarantees exists. `jskit test --databases` checks each against an app's test database. `usersForeignKeyMigration.test.js` proves it matches the migrations.
6
7
  - `console.settings` reads and writes its record with only the caller's context and transaction (`passedOn(options)`) and its own settings: a caller's `format`, `lockVersion` or `returning` no longer reaches its `get` and `patch`.
7
8
  - `@jskit-ai/database-runtime` and `@jskit-ai/resource-runtime` are peer dependencies, required and at the same versions, where they were dependencies: its settings are a table resource, and the app holds one copy of the table runtime that every package shares, as it does the kernel. npm installs a required peer as it installed the dependency, so an app installs the same packages and versions; a release whose versions disagree now fails the install with ERESOLVE instead of nesting a second copy.
@@ -0,0 +1,18 @@
1
+ // Knex sorts this file just before console_core_generic_initial.cjs ("-" sorts before "."), so it runs first on
2
+ // every database that has not run it. It runs that released migration with each table it creates in the collation
3
+ // of console_settings, or of the next table listed that exists, instead of the database's default, and repairs a
4
+ // table that default left: see migrateInExistingCollation. The released migration then finds its tables in place.
5
+ const released = require("./console_core_generic_initial.cjs");
6
+
7
+ exports.up = async function up(knex) {
8
+ const { migrateInExistingCollation } = await import("@jskit-ai/database-runtime/server/tableCollationMigrations");
9
+ await migrateInExistingCollation(knex, {
10
+ migration: "console_core_generic_initial.cjs",
11
+ up: released.up,
12
+ tables: ["console_settings"],
13
+ referenceTables: ["console_settings", "users", "auth_local_users"]
14
+ });
15
+ };
16
+
17
+ // The released migration's down drops its tables.
18
+ exports.down = async function down() {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/console-core",
3
- "version": "0.2.54",
3
+ "version": "0.2.56",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "jskit test"
@@ -12,8 +12,8 @@
12
12
  "./locales/en.json": "./locales/en.json"
13
13
  },
14
14
  "dependencies": {
15
- "@jskit-ai/resource-core": "0.1.218",
16
- "@jskit-ai/users-core": "0.2.54",
15
+ "@jskit-ai/resource-core": "0.1.219",
16
+ "@jskit-ai/users-core": "0.2.56",
17
17
  "json-rest-schema": "^1.0.20"
18
18
  },
19
19
  "description": "Console runtime: console settings schema, bootstrap flags, actions, and HTTP routes.",
@@ -97,10 +97,10 @@
97
97
  }
98
98
  },
99
99
  "peerDependencies": {
100
- "@jskit-ai/auth-core": "0.2.31",
101
- "@jskit-ai/database-runtime": "0.1.276",
102
- "@jskit-ai/http-runtime": "0.2.27",
103
- "@jskit-ai/kernel": "0.2.27",
104
- "@jskit-ai/resource-runtime": "0.2.40"
100
+ "@jskit-ai/auth-core": "0.2.32",
101
+ "@jskit-ai/database-runtime": "0.1.278",
102
+ "@jskit-ai/http-runtime": "0.2.28",
103
+ "@jskit-ai/kernel": "0.2.28",
104
+ "@jskit-ai/resource-runtime": "0.2.42"
105
105
  }
106
106
  }