@strav/cli 0.4.4 → 0.4.5
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strav/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI framework and code generators for the Strav framework",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"strav": "./src/cli/strav.ts"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@strav/kernel": "0.4.
|
|
37
|
-
"@strav/http": "0.4.
|
|
38
|
-
"@strav/database": "0.4.
|
|
39
|
-
"@strav/queue": "0.4.
|
|
40
|
-
"@strav/signal": "0.4.
|
|
36
|
+
"@strav/kernel": "0.4.5",
|
|
37
|
+
"@strav/http": "0.4.5",
|
|
38
|
+
"@strav/database": "0.4.5",
|
|
39
|
+
"@strav/queue": "0.4.5",
|
|
40
|
+
"@strav/signal": "0.4.5"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"chalk": "^5.6.2",
|
|
@@ -21,7 +21,10 @@ export function register(program: Command): void {
|
|
|
21
21
|
|
|
22
22
|
console.log(chalk.cyan('Comparing schema with database...'))
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
// Tenant table name + idType are read from the registered tenant
|
|
25
|
+
// schema (the one with `tenantRegistry: true`). Defaults to
|
|
26
|
+
// `tenant` / `bigint` if no schema is registered.
|
|
27
|
+
const desired = registry.buildRepresentation()
|
|
25
28
|
const actual = await introspector.introspect()
|
|
26
29
|
const diff = new SchemaDiffer().diff(desired, actual)
|
|
27
30
|
|
|
@@ -36,7 +39,11 @@ export function register(program: Command): void {
|
|
|
36
39
|
return
|
|
37
40
|
}
|
|
38
41
|
|
|
39
|
-
const sql = new SqlGenerator(
|
|
42
|
+
const sql = new SqlGenerator(
|
|
43
|
+
database.tenantIdType,
|
|
44
|
+
database.tenantTableName,
|
|
45
|
+
database.tenantFkColumn
|
|
46
|
+
).generate(diff)
|
|
40
47
|
const version = Date.now().toString()
|
|
41
48
|
const tableOrder = desired.tables.map(t => t.name)
|
|
42
49
|
|