const config = require('../../config');
const providers = config.providers;
const crypto = require('crypto');
const bcrypt = require('bcrypt');
const moment = require('moment');

module.exports = function(sequelize, DataTypes) {
  const supplement_evidence_items = sequelize.define(
    'supplement_evidence_items',
    {
      id: {
        type: DataTypes.UUID,
        defaultValue: DataTypes.UUIDV4,
        primaryKey: true,
      },

supplement_name: {
        type: DataTypes.TEXT,
      
      

      },

evidence_rating: {
        type: DataTypes.INTEGER,
      
      

      },

summary: {
        type: DataTypes.TEXT,
      
      

      },

mechanism: {
        type: DataTypes.TEXT,
      
      

      },

benefits: {
        type: DataTypes.TEXT,
      
      

      },

dosing_range: {
        type: DataTypes.TEXT,
      
      

      },

timing_recommendations: {
        type: DataTypes.TEXT,
      
      

      },

interactions: {
        type: DataTypes.TEXT,
      
      

      },

side_effects: {
        type: DataTypes.TEXT,
      
      

      },

avoid_who: {
        type: DataTypes.TEXT,
      
      

      },

      importHash: {
        type: DataTypes.STRING(255),
        allowNull: true,
        unique: true,
      },
    },
    {
      timestamps: true,
      paranoid: true,
      freezeTableName: true,
    },
  );

  supplement_evidence_items.associate = (db) => {


/// loop through entities and it's fields, and if ref === current e[name] and create relation has many on parent entity


















































































































//end loop






    db.supplement_evidence_items.belongsTo(db.users, {
      as: 'createdBy',
    });

    db.supplement_evidence_items.belongsTo(db.users, {
      as: 'updatedBy',
    });
  };



  return supplement_evidence_items;
};


