import { DataTypes } from 'sequelize';
export default (sequelize) => sequelize.define('correspondences', {
  correspondence_id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
  project_id:        { type: DataTypes.INTEGER, allowNull: false },
  corr_no:           { type: DataTypes.STRING(100), allowNull: false, unique: true },
  subject:           { type: DataTypes.STRING(255) },
  category:          { type: DataTypes.STRING(100) },
  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: ['project_id'] }, { fields: ['status'] }, { unique: true, fields: ['corr_no'] }] });
