Skip to content

Commit

Permalink
fix: Add check for rules object
Browse files Browse the repository at this point in the history
Signed-off-by: DanceParty <keevandance@gmail.com>
  • Loading branch information
DanceParty committed Mar 14, 2021
1 parent 49f3848 commit 54ed736
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,8 @@ var PgDriver = Base.extend({
this.quoteDDLArr(columns).join(', '),
referencedTableName,
referencedColumns.join(', '),
rules.onDelete || 'NO ACTION',
rules.onUpdate || 'NO ACTION'
(rules && rules.onDelete) || 'NO ACTION',
(rules && rules.onUpdate) || 'NO ACTION'
);
return this.runSql(sql).nodeify(callback);
},
Expand Down

0 comments on commit 54ed736

Please sign in to comment.