Skip to content

Commit 3cb4841

Browse files
committed
fix: misc
Signed-off-by: Muhammad Aaqil <[email protected]>
1 parent 73792a9 commit 3cb4841

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/cli/generators/model/index.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,20 @@ module.exports = class ModelGenerator extends ArtifactGenerator {
302302
])
303303
.then(setting => {
304304
Object.assign(this.artifactInfo, setting);
305-
306305
if (this.artifactInfo.allowAdditionalProperties) {
307306
Object.assign(this.artifactInfo.modelSettings, {strict: false});
308307
}
308+
309+
const dsType = this.artifactInfo.dataSourceType;
310+
if (!this.artifactInfo.modelSettings)
311+
this.artifactInfo.modelSettings = {};
312+
if (dsType === 'relational') {
313+
this.artifactInfo.allowAdditionalProperties = false;
314+
this.artifactInfo.modelSettings.strict = true;
315+
} else {
316+
this.artifactInfo.allowAdditionalProperties = true;
317+
this.artifactInfo.modelSettings.strict = false;
318+
}
309319
// inform user what model/file names will be created
310320
super.promptClassFileName(
311321
'model',

0 commit comments

Comments
 (0)