import { DataTypes } from 'sequelize';
export default (sequelize) => sequelize.define('sub_categories', {
  sub_cat_id:    { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
  project_id:    { type: DataTypes.INTEGER, allowNull: false },
  sub_cat_name:  { type: DataTypes.STRING(255), allowNull: false },
  parent_cat_id: { type: DataTypes.INTEGER },
  code:          { type: DataTypes.STRING(100) },
  created_at:    { type: DataTypes.DATE },
  updated_at:    { type: DataTypes.DATE },
}, { indexes: [{ fields:['project_id'] }, { fields:['sub_cat_name'] }] });
