<commit_before>const User = require("../models/User");
const Friend = require("../models/Friend");
const MessageRoom = require("../models/MessageRoom");
const Message = require("../models/Message");
const MessageStatus = require("../models/MessageStatus");
const Premium = require("../models/Premium");
const Post = require("../models/Post");
const Video = require("../models/Video");
const Rating = require("../models/Rating");
const Comment = require("../models/Comment");
const Merchant = require("../models/Merchant");
const Item = require("../models/Item");

User.sync()
  .then(function() {
    Friend.belongsTo(User, {
      as: "from",
      foreignKey: "userId"
    });<commit_msg>testing<commit_after>const User = require("../models/User");
const Friend = require("../models/Friend");
const MessageRoom = require("../models/MessageRoom");
const Message = require("../models/Message");
const MessageStatus = require("../models/MessageStatus");
const Premium = require("../models/Premium");
const Post = require("../models/Post");
const Video = require("../models/Video");
const Rating = require("../models/Rating");
const Comment = require("../models/Comment");
const Merchant = require("../models/Merchant");
const Item = require("../models/Item");
User.sync()
  .then(function() {
    Friend.belongsTo(User, {
      as: "from",
      foreignKey: "userId"
    });
    Friend.belongsTo(User, {
      as: "to",
      foreignKey: "toUserId"
    });
    User.hasMany(Friend, {
      as: "friends",
      foreignKey: "userId"
    });
    return MessageRoom.sync({force: true});
  })
  .then(function() {
    Friend.belongsTo(MessageRoom, {
      as: "messageRoom",
      foreignKey: "messageRoomId"
    });
    MessageRoom.hasMany(Friend, {
      as: "friends",
      foreignKey: "messageRoomId"
    });
    return Friend.sync({force: true});
  })
  .then(function() {
    Message.belongsTo(MessageRoom, {
      as: "messageRoom",
      foreignKey: "messageRoomId"
    });
    MessageRoom.hasMany(Message, {
      as: "messages",
      foreignKey: "messageRoomId"
    });
    Message.belongsTo(User, {
      as: "user",
      foreignKey: "userId"
    });
    return Message.sync({force: true});
  })
  .then(function() {
    MessageStatus.belongsTo(User, {
      as: "user",
      foreignKey: "userId"
    });
    User.hasMany(MessageStatus, {
      as: "messageStatuses",
      foreignKey: "userId"
    });
    MessageStatus.belongsTo(User, {
      as: "from",
      foreignKey: "fromUserId"
    });
    MessageStatus.belongsTo(MessageRoom, {
      as: "in",
      foreignKey: "inMessageRoomId"
    });
    return MessageStatus.sync({force: true});
  })
  .then(function() {
    Premium.belongsTo(User, {
      as: "user",
      foreignKey: "userId"
    });
    User.hasMany(Premium, {
      as: "premiumNotifications",
      foreignKey: "userId"
    });
    return Premium.sync({force: true});
  })
  .then(function() {
    Post.belongsTo(User, {
      as: "user",
      foreignKey: "userId"
    });
    User.hasMany(Post, {
      as: "posts",
      foreignKey: "userId"
    });
    return Post.sync({force: true});
  })
  .then(function() {
    Video.belongsTo(User, {
      as: "user",
      foreignKey: "userId"
    });
    User.hasMany(Video, {
      as: "videos",
      foreignKey: "userId"
    });
    return Video.sync({force: true});
  })
  .then(function() {
    Rating.belongsTo(User, {
      as: "user",
      foreignKey: "userId"
    });
    Rating.belongsTo(Video, {
      as: "video",
      foreignKey: "videoId"
    });
    return Rating.sync({force: true});
  })
  .then(function() {
    Comment.belongsTo(User, {
      as: "user",
      foreignKey: "userId"
    });
    Video.hasMany(Comment, {
      as: "comments",
      foreignKey: "videoId"
    });
    Comment.belongsTo(Video, {
      as: "video",
      foreignKey: "videoId"
    });
    return Comment.sync({force: true});
  })
  .then(function() {
    Merchant.belongsTo(User, { as: "user", foreignKey: "userId" });
    return Merchant.sync({force: true});
  })
  .then(function() {
    Item.belongsTo(Merchant, { as: "merchant", foreignKey: "merchnatID" });
    Merchant.hasMany(Item, { as: "item", foreignKey: "merchantID" });
    return Item.sync({force: true});
  });




User.sync()
  .then(function() {
    Friend.belongsTo(User, {
      as: "from",
      foreignKey: "userId"
    });
{'fraction_non_alphanumeric': 0.1857698467169984, 'fraction_numerical': 0.0, 'mean_word_length': 2.889679715302491, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6764706', 'n_tokens_mistral': 1415, 'n_tokens_neox': 1417, 'n_words': 261}