import { DataTypes } from 'sequelize';
export default (sequelize) => sequelize.define('projects', {
  project_id:   { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
  project_code: { type: DataTypes.STRING(50), allowNull: false, unique: true },
  project_name: { type: DataTypes.STRING(255), allowNull: false },
  status:       { type: DataTypes.STRING(50) },
  created_at:   { type: DataTypes.DATE },
  updated_at:   { type: DataTypes.DATE },
}, { indexes: [{ unique:true, fields:['project_code'] }] });
