{"size": 705, "ext": "js", "max_stars_repo_path": "models/index.js", "max_stars_repo_name": "Mariafcc/skindex2.0", "max_stars_repo_stars_event_min_datetime": "2021-06-30T22:05:58.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-30T22:05:58.000Z", "max_issues_repo_path": "models/index.js", "max_issues_repo_name": "Mariafcc/skindex2.0", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "models/index.js", "max_forks_repo_name": "Mariafcc/skindex2.0", "max_forks_repo_forks_event_min_datetime": "2020-12-02T16:34:50.000Z", "max_forks_repo_forks_event_max_datetime": "2020-12-02T16:34:50.000Z"}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 17.625, "max_line_length": 62, "alphanum_fraction": 0.6836879433}
const config = require("../config/db.config");
const Sequelize = require("sequelize");

const sequelize = new Sequelize(
	config.DB,
	config.USER,
	config.PASSWORD,
	{
		host: config.HOST,
		dialect: config.dialect,
		operatorsAliases: false,

		pool: {
			max: config.pool.max,
			min: config.pool.min,
			acquire: config.pool.acquire,
			idle: config.pool.idle
		}
	}
);

const db = {};

db.Sequelize = Sequelize;
db.sequelize = sequelize;

db.user = require("./user.model")(sequelize, Sequelize);
db.product = require("./product.model")(sequelize, Sequelize);

db.result = require("./result.model")(sequelize, Sequelize);

db.user.hasMany(db.result, {foreignKey: 'userId'});


module.exports = db;




