import { DataTypes } from 'sequelize';
export default (sequelize) => sequelize.define('transmittal_items', {
  tr_item_id:     { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
  transmittal_id: { type: DataTypes.INTEGER, allowNull: false },
  item_type:      { type: DataTypes.STRING(30), allowNull: false }, // DRAWING/RFA/DOCUMENT
  ref_id:         { type: DataTypes.INTEGER, allowNull: false },
  remark:         { type: DataTypes.STRING(255) },
  created_at:     { type: DataTypes.DATE },
  updated_at:     { type: DataTypes.DATE },
}, { indexes: [{ fields:['transmittal_id'] }, { fields:['item_type','ref_id'] }] });
