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(