import { DataTypes } from 'sequelize';
export default (sequelize) => sequelize.define('correspondence_versions', {
  corr_ver_id:   { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
  correspondence_id: { type: DataTypes.INTEGER, allowNull: false },
  version_no:    { type: DataTypes.INTEGER, allowNull: false },
  body:          { type: DataTypes.TEXT },
  status:        { type: DataTypes.STRING(50) },
  created_by:    { type: DataTypes.INTEGER },
  updated_by:    { type: DataTypes.INTEGER },
  created_at:    { type: DataTypes.DATE },
  updated_at:    { type: DataTypes.DATE },
}, { indexes: [{ fields: ['correspondence_id'] }, { fields: ['status'] }] });
