mirror of
https://github.com/strapi/strapi.git
synced 2025-08-03 06:18:37 +00:00
14 lines
590 B
Plaintext
Executable File
14 lines
590 B
Plaintext
Executable File
|
|
/**
|
|
* Create the `<%= tableName %>` table if it doesn't exist yet.
|
|
*/
|
|
|
|
connection.schema.createTableIfNotExists('<%= tableName %>', function (table) {<% if (_.isObject(options)) { _.forEach(options, function(value, option) { %><% if (models[tableName].options[option] !== false) { %>
|
|
<%= models[tableName][option] %>;<% } %><% }); } %>
|
|
<% _.forEach(attributes, function(details, attribute) { %><%= models[tableName].attributes[attribute].create.others %>;
|
|
<% }); %>
|
|
}).catch(function (err) {
|
|
console.log('Impossible to create the `<%= tableName %>` table.');
|
|
console.log(err);
|
|
}),
|