diff --git a/lib/migration.js b/lib/migration.js index b2e68c72..d5fde840 100644 --- a/lib/migration.js +++ b/lib/migration.js @@ -321,30 +321,30 @@ function mixinMigration(PostgreSQL) { return result; }; - /** Create extension for uuid when attribute is set to dataType uuid - * and auto-generated. - * @param {String} model The model name - * - */ - PostgreSQL.prototype.checksExtention = function(model) { - const self = this; - - Object.keys(self.getModelDefinition(model).properties).forEach(function(prop, model) { - let postgreType = prop; - if (prop.postgresql && prop.postgresql.dataType) { - postgreType = prop.postgresql.dataType.toUpperCase(); - } - - if (prop.generated && postgreType === 'UUID') { - self.execute('CREATE EXTENSION IF NOT EXISTS "uuid-ossp";', - (err, fields) => { - if (err) { - return cb(err); - }; - }); - } - }); - } + // /** Create extension for uuid when attribute is set to dataType uuid + // * and auto-generated. + // * @param {String} model The model name + // * + // */ + // PostgreSQL.prototype.checksExtention = function(model) { + // const self = this; + + // Object.keys(self.getModelDefinition(model).properties).forEach(function(prop, model) { + // let postgreType = prop; + // if (prop.postgresql && prop.postgresql.dataType) { + // postgreType = prop.postgresql.dataType.toUpperCase(); + // } + + // if (prop.generated && postgreType === 'UUID') { + // self.execute('CREATE EXTENSION IF NOT EXISTS "uuid-ossp";', + // (err, fields) => { + // if (err) { + // return cb(err); + // }; + // }); + // } + // }); + // } /*! * Create a table for the given model @@ -354,12 +354,13 @@ function mixinMigration(PostgreSQL) { PostgreSQL.prototype.createTable = function(model, cb) { const self = this; const name = self.tableEscaped(model); - self.checksExtention(model, (err)=>{ - cb(err); - }); + // self.checksExtention(model, (err)=>{ + // cb(err); + // }); // Please note IF NOT EXISTS is introduced in postgresql v9.3 self.execute( + 'CREATE EXTENSION IF NOT EXISTS "uuid-ossp";'+ 'CREATE SCHEMA ' + self.escapeName(self.schema(model)), function(err) {