pangea-server 1.0.79 → 1.0.81
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.
|
@@ -270,7 +270,7 @@ function getInclude(model, config = {}, relDepth = new Map()) {
|
|
|
270
270
|
const maxDepth = rel.joinDepth;
|
|
271
271
|
if (currentDepth >= maxDepth)
|
|
272
272
|
continue;
|
|
273
|
-
if (rel.
|
|
273
|
+
if (rel.notInclude)
|
|
274
274
|
continue;
|
|
275
275
|
const relWhere = cleanWhere[relName];
|
|
276
276
|
delete cleanWhere[relName];
|
|
@@ -35,8 +35,8 @@ function getRelation(relationFn) {
|
|
|
35
35
|
const { foreignKey, ...relOptions } = options;
|
|
36
36
|
relationFn(getModelFn, { as: propertyName, ...(foreignKey && { foreignKey }) })(target, propertyName);
|
|
37
37
|
const model = target.constructor;
|
|
38
|
-
const {
|
|
39
|
-
model.AddRelation(propertyName, { getModelFn,
|
|
38
|
+
const { notInclude = false, required = relationFn === seq.BelongsTo ? !model.Columns[`${propertyName}Id`].allowNull : false, paranoid = relationFn !== seq.BelongsTo, joinDepth = 1, ...restOptions } = relOptions;
|
|
39
|
+
model.AddRelation(propertyName, { getModelFn, notInclude, required, paranoid, joinDepth, ...restOptions });
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
42
|
}
|