Skip to content

Commit

Permalink
Merge pull request #17 from drognisep/master
Browse files Browse the repository at this point in the history
May allow generation of foreign keys
  • Loading branch information
adrianandrei-ca authored Aug 15, 2018
2 parents 7e2e9b6 + ac0c552 commit 06eb02c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class DDLGenerator {


/**
* Write Foreign Keys
* Create indexes for Foreign Key columns
* @param {StringWriter} codeWriter
* @param {type.ERDEntity} elem
* @param {Object} options
Expand Down Expand Up @@ -310,7 +310,7 @@ class DDLGenerator {
if (column && col.foreignKey && !col.primaryKey) {
foreignKeys.push(column);
}
if (options.foreignKey && col.referenceTo) {
if (options.foreignKeyConstraint && col.referenceTo) {
foreignKeyCtr.push(col);
}
}
Expand Down
2 changes: 1 addition & 1 deletion preferences/preference.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"text": "Generate Foregin Key Constraints",
"description": "Generate Foreign Key constraint when reference field is populated.",
"type": "check",
"default": false
"default": true
},
"psqlddl.gen.useTab": {
"text": "Use Tab",
Expand Down

0 comments on commit 06eb02c

Please sign in to comment.