{"size": 881, "ext": "js", "max_stars_repo_path": "backend/src/models/lifecyclehistory.js", "max_stars_repo_name": "TimCsaky/nr-get-token", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "backend/src/models/lifecyclehistory.js", "max_issues_repo_name": "TimCsaky/nr-get-token", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "backend/src/models/lifecyclehistory.js", "max_forks_repo_name": "TimCsaky/nr-get-token", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.4722222222, "max_line_length": 69, "alphanum_fraction": 0.5970488082}
module.exports = (sequelize, DataTypes) => {
  const LifecycleHistory = sequelize.define('LifecycleHistory', {
    lifecycleHistoryId: {
      allowNull: false,
      autoIncrement: true,
      primaryKey: true,
      type: DataTypes.INTEGER,
      validate: {
        min: 1
      }
    },
    env: {
      allowNull: false,
      comment: 'What environment this history event was deployed to',
      type: DataTypes.STRING(4),
      validate: {
        isIn: [
          ['INT', 'TEST', 'PROD']
        ]
      }
    }
  }, {
    comment: 'History of changes to the promotion lifecycle',
    tableName: 'lifecycle_history'
  });
  LifecycleHistory.associate = models => {
    LifecycleHistory.belongsTo(models.Lifecycle, {
      foreignKey: 'lifecycleId'
    });
    LifecycleHistory.belongsTo(models.User, {
      foreignKey: 'userId'
    });
  };
  return LifecycleHistory;
};
