@contember/engine-system-api 2.1.0-beta.1 → 2.1.0-beta.2
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/dist/development/src/model/migrations/SchemaProvider.cjs +1 -1
- package/dist/development/src/model/migrations/SchemaProvider.cjs.map +1 -1
- package/dist/development/src/model/migrations/SchemaProvider.js +1 -1
- package/dist/development/src/model/migrations/SchemaProvider.js.map +1 -1
- package/dist/development/src/model/queries/schema/SchemaQuery.cjs +5 -1
- package/dist/development/src/model/queries/schema/SchemaQuery.cjs.map +1 -1
- package/dist/development/src/model/queries/schema/SchemaQuery.js +5 -1
- package/dist/development/src/model/queries/schema/SchemaQuery.js.map +1 -1
- package/dist/production/src/model/migrations/SchemaProvider.cjs +1 -1
- package/dist/production/src/model/migrations/SchemaProvider.cjs.map +1 -1
- package/dist/production/src/model/migrations/SchemaProvider.js +1 -1
- package/dist/production/src/model/migrations/SchemaProvider.js.map +1 -1
- package/dist/production/src/model/queries/schema/SchemaQuery.cjs +5 -1
- package/dist/production/src/model/queries/schema/SchemaQuery.cjs.map +1 -1
- package/dist/production/src/model/queries/schema/SchemaQuery.js +5 -1
- package/dist/production/src/model/queries/schema/SchemaQuery.js.map +1 -1
- package/dist/tests/tsconfig.tsbuildinfo +1 -1
- package/dist/types/model/queries/schema/SchemaQuery.d.ts +2 -1
- package/dist/types/model/queries/schema/SchemaQuery.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/model/migrations/SchemaProvider.ts +1 -1
- package/src/model/queries/schema/SchemaQuery.ts +4 -0
- package/vitest.config.ts +0 -3
package/package.json
CHANGED
|
@@ -66,7 +66,7 @@ export class SchemaProvider {
|
|
|
66
66
|
db: DatabaseContext
|
|
67
67
|
currentSchema?: SchemaWithMeta | null
|
|
68
68
|
}): Promise<SchemaWithMeta> {
|
|
69
|
-
const newSchema = await db.queryHandler.fetch(new SchemaQuery(currentSchema?.meta.checksum))
|
|
69
|
+
const newSchema = await db.queryHandler.fetch(new SchemaQuery(currentSchema?.meta.checksum, currentSchema?.meta.version))
|
|
70
70
|
if (!newSchema) {
|
|
71
71
|
return currentSchema ?? emptyVersionedSchema
|
|
72
72
|
}
|
|
@@ -5,6 +5,7 @@ import { SchemaWithMeta } from '../../migrations'
|
|
|
5
5
|
export class SchemaQuery extends DatabaseQuery<SchemaWithMeta | null> {
|
|
6
6
|
constructor(
|
|
7
7
|
private readonly currentHash?: string,
|
|
8
|
+
private readonly currentVersion?: string,
|
|
8
9
|
) {
|
|
9
10
|
super()
|
|
10
11
|
}
|
|
@@ -26,6 +27,9 @@ export class SchemaQuery extends DatabaseQuery<SchemaWithMeta | null> {
|
|
|
26
27
|
if (!this.currentHash) {
|
|
27
28
|
return it
|
|
28
29
|
}
|
|
30
|
+
if (this.currentVersion) {
|
|
31
|
+
return it.where(it => it.raw('(checksum != ? OR version != ?)', this.currentHash, this.currentVersion))
|
|
32
|
+
}
|
|
29
33
|
return it.where(it => it.raw('checksum != ?', this.currentHash))
|
|
30
34
|
})
|
|
31
35
|
|
package/vitest.config.ts
DELETED