Skip to content

Commit

Permalink
fix: issue #400 fixed .
Browse files Browse the repository at this point in the history
-fix for #400 issue .
  • Loading branch information
saeedtabrizi authored and wolf4ood committed Nov 4, 2019
1 parent f61b787 commit e3ca11c
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions lib/db/sequence/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -236,4 +233,4 @@ Sequence.cacheData = function (sequences) {
}

return this;
};
};

0 comments on commit e3ca11c

Please sign in to comment.