Skip to content

Commit

Permalink
edit
Browse files Browse the repository at this point in the history
  • Loading branch information
Agnes Lin committed Dec 13, 2019
1 parent 371d53a commit 3789475
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/migration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
});
}
});
}
Expand All @@ -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(
Expand Down

0 comments on commit 3789475

Please sign in to comment.