%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/opti/workflow/node_modules/sequelize-cli/lib/assets/models/
Upload File :
Create Path :
Current File : /home/opti/workflow/node_modules/sequelize-cli/lib/assets/models/model.js

'use strict';

module.exports = (sequelize, DataTypes) => {
  const <%= name %> = sequelize.define('<%= name %>', {
    <% attributes.forEach(function(attribute, index) { %>
      <%= attribute.fieldName %>: DataTypes.<%= attribute.dataFunction ? `${attribute.dataFunction.toUpperCase()}(DataTypes.${attribute.dataType.toUpperCase()})` : attribute.dataValues ? `${attribute.dataType.toUpperCase()}(${attribute.dataValues})` : attribute.dataType.toUpperCase() %>
      <%= (Object.keys(attributes).length - 1) > index ? ',' : '' %>
    <% }) %>
  }, {
    <%= underscored ? 'underscored: true,' : '' %>
  });

  <%= name %>.associate = function(models) {
    // associations can be defined here
  };

  return <%= name %>;
};

Zerion Mini Shell 1.0