mirror of
https://github.com/strapi/strapi.git
synced 2025-08-28 02:35:55 +00:00
Fix PR feedback
This commit is contained in:
parent
054df448a9
commit
f545f373aa
@ -235,10 +235,13 @@ module.exports = {
|
||||
syncSchema: (cb) => {
|
||||
const Model = strapi.plugins['users-permissions'].models.user;
|
||||
|
||||
if (Model.orm === 'bookshelf') {
|
||||
if (Model.orm !== 'bookshelf') {
|
||||
return cb();
|
||||
}
|
||||
|
||||
const tableName = Model.collectionName;
|
||||
|
||||
let queue = new Promise((resolve, reject) => {
|
||||
new Promise((resolve, reject) => {
|
||||
strapi.connections[Model.connection].schema.hasTable(tableName)
|
||||
.then(exist => {
|
||||
if (!exist) {
|
||||
@ -266,9 +269,8 @@ CREATE TABLE "${tableName}" (
|
||||
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
queue = queue.then(() => {
|
||||
})
|
||||
.then(() => {
|
||||
const attributes = _.cloneDeep(Model.attributes);
|
||||
attributes.id = {
|
||||
type: 'integer'
|
||||
@ -296,12 +298,7 @@ CREATE TABLE "${tableName}" (
|
||||
});
|
||||
};
|
||||
|
||||
const testsColumns = [];
|
||||
|
||||
_.forEach(attributes, (description, attribute) => {
|
||||
testsColumns.push(columnExist(description, attribute));
|
||||
});
|
||||
|
||||
const testsColumns = Object.entries(attributes).map(([attribute, description]) => columnExist(description, attribute));
|
||||
Promise.all(testsColumns)
|
||||
.then(() => {
|
||||
if (!_.isEmpty(commands)) {
|
||||
@ -320,8 +317,5 @@ ${commands}
|
||||
cb();
|
||||
});
|
||||
});
|
||||
} else {
|
||||
cb();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user