const { Sequelize, DataTypes } = require("sequelize");

const sequelize = new Sequelize("gogyani_bmcdb", "gogyani_bmcuser", "CXuY##G8Abe!", {
  host: "198.38.87.121",
  dialect: "mysql",
  logging: false,
  port:3306,
  logging: false,
  pool: {
    max: 5,
    min: 0,
    acquire: 30000,
    idle: 10000,
  },
});

const db = {};
db.sequelize = sequelize;
db.Sequelize = Sequelize;

// Initialize models
db.College = require("./collegeModel/collegeModel")(sequelize, DataTypes);
db.Landingpage = require("./collegeModel/landingPageModel")(
  sequelize,
  DataTypes
);
db.Company = require("./collegeModel/CompanyModel")(sequelize, DataTypes);
db.ImportantDate = require("./collegeModel/importantdateModel")(
  sequelize,
  DataTypes
);
db.Blog = require("./Blog/blogModel")(sequelize, DataTypes);
db.BlogTag = require("./Blog/blogTagModel")(sequelize, DataTypes);

// Define relationships (if any)
// Example: db.College.hasMany(db.Blog, { foreignKey: 'college_id' });

module.exports = db;
