From 37894751e37ff9c0328a790af75318695a97b15f Mon Sep 17 00:00:00 2001 From: Agnes Lin Date: Fri, 13 Dec 2019 15:41:48 -0500 Subject: [PATCH] edit --- lib/migration.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/migration.js b/lib/migration.js index 1f83cd78..b2e68c72 100644 --- a/lib/migration.js +++ b/lib/migration.js @@ -335,15 +335,13 @@ function mixinMigration(PostgreSQL) { postgreType = prop.postgresql.dataType.toUpperCase(); } - if (prop.generated) { - if (postgreType === 'UUID') { - self.execute('CREATE EXTENSION IF NOT EXISTS "uuid-ossp";', - (err, fields) => { - if (err) { - return cb(err); - }; - }); - } + if (prop.generated && postgreType === 'UUID') { + self.execute('CREATE EXTENSION IF NOT EXISTS "uuid-ossp";', + (err, fields) => { + if (err) { + return cb(err); + }; + }); } }); } @@ -356,7 +354,9 @@ function mixinMigration(PostgreSQL) { PostgreSQL.prototype.createTable = function(model, cb) { const self = this; const name = self.tableEscaped(model); - self.checksExtention(model); + self.checksExtention(model, (err)=>{ + cb(err); + }); // Please note IF NOT EXISTS is introduced in postgresql v9.3 self.execute(