const { DataTypes } = require("sequelize");
const sequelize = require("../db");

const HazopStudy = sequelize.define("HazopStudy", {
  data: {
    type: DataTypes.JSON,
    allowNull: false,
    defaultValue: {},
  },
  ProjectId: {
    type: DataTypes.INTEGER,
    allowNull: false,
    references: {
      model: "Projects",
      key: "id",
    },
  },
  createdById: {
    type: DataTypes.INTEGER,
    allowNull: false,
    references: {
      model: "Users",
      key: "id",
    },
  },
});

module.exports = HazopStudy;
