diff --git a/lib/db/sequence/index.js b/lib/db/sequence/index.js index 9a71ed23..8703a057 100644 --- a/lib/db/sequence/index.js +++ b/lib/db/sequence/index.js @@ -94,9 +94,8 @@ Sequence.create = function (name, type, start, incerement, cache) { if (incerement) { query += ' CACHE ' + cache; } - - return this - .query(query) + const ex = this.command || this.exec; + return ex(query) .bind(this) .then(function () { return this @@ -149,9 +148,8 @@ Sequence.update = function (name, start, incerement, cache) { if (incerement) { query += ' CACHE ' + cache; } - - return this - .query(query) + const ex = this.command || this.exec; + return ex(query) .bind(this) .then(function () { return this @@ -170,9 +168,8 @@ Sequence.update = function (name, start, incerement, cache) { Sequence.drop = function (name, config) { config = config || {}; var query = 'DROP SEQUENCE ' + name; - - return this - .exec(query) + const ex = this.command || this.exec; + return ex(query) .bind(this) .then(function () { return this @@ -236,4 +233,4 @@ Sequence.cacheData = function (sequences) { } return this; -}; \ No newline at end of file +};