From 403113ea6a40be6ea79c3ac3c099c52d04cc5ade Mon Sep 17 00:00:00 2001 From: ryan quinn Date: Tue, 15 Dec 2015 20:13:36 -0500 Subject: [PATCH 1/2] create triggers if they exist on a model --- dist/adapter.js | 8 ++++++++ lib/adapter.js | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/dist/adapter.js b/dist/adapter.js index ab307b6..b400ad3 100644 --- a/dist/adapter.js +++ b/dist/adapter.js @@ -145,6 +145,14 @@ var adapter = { }); } + if (!_lodash2['default'].isEmpty(collection.triggers)) { + collection.triggers.forEach(function (trigger) { + queries.push({ + sql: trigger + }); + }); + } + // need to create sequence and trigger for auto increment this.executeQuery(connectionName, queries).nodeify(cb); }, diff --git a/lib/adapter.js b/lib/adapter.js index 34f874f..70889aa 100644 --- a/lib/adapter.js +++ b/lib/adapter.js @@ -129,6 +129,14 @@ const adapter = { }) } + if (!_.isEmpty(collection.triggers)) { + collection.triggers.forEach(trigger => { + queries.push({ + sql: trigger + }) + }) + } + // need to create sequence and trigger for auto increment this.executeQuery(connectionName, queries).nodeify(cb) From cc75465f200cab113c25717a2b143dabd6573590 Mon Sep 17 00:00:00 2001 From: ryan quinn Date: Fri, 12 Aug 2016 11:22:02 -0700 Subject: [PATCH 2/2] adding travis.yml --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f98171d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: +- '0.12' +- '4.2' +- 'stable'