{"size": 775, "ext": "js", "max_stars_repo_path": "models/index.js", "max_stars_repo_name": "veidul/CryptoChamps", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "models/index.js", "max_issues_repo_name": "veidul/CryptoChamps", "max_issues_repo_issues_event_min_datetime": "2022-01-05T04:58:06.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-08T19:00:09.000Z", "max_forks_repo_path": "models/index.js", "max_forks_repo_name": "veidul/CryptoChamps", "max_forks_repo_forks_event_min_datetime": "2022-01-15T20:50:41.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-15T20:50:41.000Z"}
{"max_stars_count": null, "max_issues_count": 4, "max_forks_count": 1, "avg_line_length": 22.1428571429, "max_line_length": 63, "alphanum_fraction": 0.6851612903}
const User = require("./user.js");
const Tourney = require("./tourney.js");
const Wallet = require("./wallet.js");
const Coins = require("./coins.js");
const TourneyUser = require("./tourneyUser");

User.hasMany(Wallet, {
  foreignKey: "user_id",
});
Tourney.hasMany(Wallet, {
  foreignKey: "tourney_id",
});
Wallet.belongsTo(User, {
  foreignKey: "user_id",
});
Wallet.belongsTo(Tourney, {
  foreignKey: "tourney_id",
});
Wallet.hasMany(Coins, {
  foreignKey: "wallet_id",
});
Coins.belongsTo(Wallet, {
  foreignKey: "wallet_id",
});
Tourney.belongsToMany(User, {
  through: "tourney_user",
  foreignKey: "tourney_id",
});

User.belongsToMany(Tourney, {
  through: "tourney_user",
  foreignKey: "user_id",
});
module.exports = { User, Tourney, Wallet, Coins, TourneyUser };
