@tachybase/database 1.3.55-alpha.1 → 1.6.0-alpha.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.
|
@@ -64,6 +64,7 @@ const _BelongsToField = class _BelongsToField extends import_relation_field.Rela
|
|
|
64
64
|
);
|
|
65
65
|
}
|
|
66
66
|
checkAssociationKeys() {
|
|
67
|
+
var _a, _b;
|
|
67
68
|
let { foreignKey, targetKey } = this.options;
|
|
68
69
|
if (!targetKey) {
|
|
69
70
|
targetKey = this.TargetModel.primaryKeyAttribute;
|
|
@@ -71,8 +72,8 @@ const _BelongsToField = class _BelongsToField extends import_relation_field.Rela
|
|
|
71
72
|
if (!foreignKey) {
|
|
72
73
|
foreignKey = import_lodash.default.camelCase(`${this.name}_${targetKey}`);
|
|
73
74
|
}
|
|
74
|
-
const targetKeyAttribute = this.TargetModel.rawAttributes[targetKey];
|
|
75
|
-
const foreignKeyAttribute = this.collection.model.rawAttributes[foreignKey];
|
|
75
|
+
const targetKeyAttribute = (_a = this.TargetModel.rawAttributes) == null ? void 0 : _a[targetKey];
|
|
76
|
+
const foreignKeyAttribute = (_b = this.collection.model.rawAttributes) == null ? void 0 : _b[foreignKey];
|
|
76
77
|
if (!foreignKeyAttribute || !targetKeyAttribute) {
|
|
77
78
|
return;
|
|
78
79
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/database",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0-alpha.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"semver": "7.7.2",
|
|
23
23
|
"sequelize": "^6.37.7",
|
|
24
24
|
"umzug": "^3.8.2",
|
|
25
|
-
"@tachybase/
|
|
26
|
-
"@tachybase/utils": "1.
|
|
27
|
-
"@tachybase/
|
|
25
|
+
"@tachybase/globals": "1.6.0-alpha.2",
|
|
26
|
+
"@tachybase/utils": "1.6.0-alpha.2",
|
|
27
|
+
"@tachybase/logger": "1.6.0-alpha.2"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/flat": "^5.0.5",
|