import { DataTypes } from 'sequelize';
export default (sequelize) => sequelize.define('drawing_revisions', {
  drawing_rev_id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
  drawing_id:     { type: DataTypes.INTEGER, allowNull: false },
  rev_no:         { type: DataTypes.STRING(50), allowNull: false },
  file_path:      { type: DataTypes.STRING(500) }, // optional: relative path stored externally
  status:         { type: DataTypes.STRING(50) },
  remark:         { type: DataTypes.STRING(500) },
  created_by:     { type: DataTypes.INTEGER },
  updated_by:     { type: DataTypes.INTEGER },
  created_at:     { type: DataTypes.DATE },
  updated_at:     { type: DataTypes.DATE },
}, { indexes: [{ fields:['drawing_id'] }, { fields:['status'] }] });
