From 050cfa5249d111454da2c98321671d3fc53e45e7 Mon Sep 17 00:00:00 2001 From: Janny Date: Fri, 3 Mar 2017 20:22:08 -0500 Subject: [PATCH] Add checkFieldAndIndex (#87) * Add checkFieldAndIndex --- lib/sql.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/sql.js b/lib/sql.js index b8866d9..f19e5b6 100644 --- a/lib/sql.js +++ b/lib/sql.js @@ -216,6 +216,10 @@ SQLConnector.prototype.alterTable = function(model, fields, indexes, cb) { throw new Error(g.f('{{alterTable()}} must be implemented by the connector')); }; +SQLConnector.prototype.checkFieldAndIndex = function(fields, indexes) { + return true; +}; + /** * Get the status of a table * @param {String} model The model name @@ -233,7 +237,7 @@ SQLConnector.prototype.getTableStatus = function(model, cb) { if (err) return cb(err); indexes = data; - if (fields && indexes) + if (self.checkFieldAndIndex(fields, indexes)) return cb(null, fields, indexes); }); });