{"size": 631, "ext": "js", "max_stars_repo_path": "files/welder/model/default.js", "max_stars_repo_name": "fabiojwalter/welder", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "files/welder/model/default.js", "max_issues_repo_name": "fabiojwalter/welder", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "files/welder/model/default.js", "max_forks_repo_name": "fabiojwalter/welder", "max_forks_repo_forks_event_min_datetime": "2019-11-19T15:13:27.000Z", "max_forks_repo_forks_event_max_datetime": "2019-11-19T15:13:27.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 19.71875, "max_line_length": 73, "alphanum_fraction": 0.5071315372}
import * as messages from 'i18n';

export default (sequelize, DataTypes) => {
  const ${model} = sequelize.define(
    '${model}',
    {
      ${field}: {
        type: DataTypes.STRING(60),
        allowNull: false,
        validate: {
          notEmpty: {
            msg: messages.__('validation.field.cannotBeNull', '${field}')
          }
        }
      },
      active: {
        type: DataTypes.BOOLEAN,
        allowNull: false,
        defaultValue: true
      }
    },
    {
      tableName: '${model}s',
      underscored: true,
      schema: process.env.DATABASE_SCHEMA || 'public'
    }
  );


  return ${model};
};
