mirror of
https://github.com/strapi/strapi.git
synced 2025-08-07 16:29:18 +00:00
20 lines
794 B
Plaintext
Executable File
20 lines
794 B
Plaintext
Executable File
|
|
/**
|
|
* Select the `<%= tableName %>` table.
|
|
*/
|
|
<% if (toDrop === true) { %>
|
|
connection.schema.table('<%= tableName %>', function (table) {
|
|
<% if (!_.isEmpty(attributes)) { _.forEach(attributes, function(details, attribute) { %><%= models[tableName].attributes[attribute].create.drop %>;
|
|
<% }); } %>
|
|
}).catch(function (err) {
|
|
console.log('Impossible to select the `<%= tableName %>` table.');
|
|
console.log(err);
|
|
}), <% } else { %>
|
|
connection.schema.table('<%= tableName %>', function (table) {
|
|
<% if (!_.isEmpty(attributes)) { _.forEach(attributes, function(details, attribute) { %><%= models[tableName].attributes[attribute].create.others %>;
|
|
<% }); } %>
|
|
}).catch(function (err) {
|
|
console.log('Impossible to select the `<%= tableName %>` table.');
|
|
console.log(err);
|
|
}),<% } %>
|