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

const BabySymptom = sequelize.define(
  "baby_symptom",
  {
    id: {
      type: DataTypes.INTEGER,
      allowNull: false,
      autoIncrement:true,
      primaryKey: true,
    },
    status: {
      type: DataTypes.STRING(255),
      allowNull: false,
    },
    createdAt: {
      type: DataTypes.DATE,
      allowNull: false,
    },
    updatedAt: {
      type: DataTypes.DATE,
      allowNull: false,
    },
    baby_id: {
      type: DataTypes.INTEGER.UNSIGNED,
      allowNull: false,
    },
  },
  {
    tableName: "baby_symptoms",
    timestamps: true,
    comment: "ml",
  }
);

// BabySymptom.belongsTo(Baby, {
//   foreignKey: "baby_id",
//   onDelete: "CASCADE",
// });

module.exports = BabySymptom;
