<commit_before>module.exports = function() {
  var db = require('./db.js');
  var Users = require('./models/userModel.js');
  var Languages = require('./models/languageModel.js');
  var Levels = require('./models/levelModel.js');
  var LanguagesLevels = require('./models/languageLevelModel.js');
  var UsersLanguagesLevels = require('./models/userLanguageLevelModel.js');
  var Messages = require('./models/messageModel.js');
  var Rooms = require('./models/roomModel.js');
  var UserRooms = require('./models/userRoomModel.js');
  var Relationships = require('./models/relationshipModel.js');
  var test = require('./controllers/getRoomIdsAndUserIdsGivenSelfId.js')


  Languages.belongsToMany(Levels, { through: 'languages_levels', foreignKey: 'language_id' });
  Levels.belongsToMany(Languages, { through: 'languages_levels', foreignKey: 'level_id' });

  Users.belongsToMany(LanguagesLevels, { through: 'users_languages_levels', foreignKey: 'user_id' });
  LanguagesLevels.belongsToMany(Users, { through: 'users_languages_levels', foreignKey: 'language_level_id' });

  Users.belongsToMany(Rooms, { through: 'users_rooms', foreignKey: 'user_id' });
  Rooms.belongsToMany(Users, { through: 'users_rooms', foreignKey: 'room_id' });

  Messages.belongsTo(Rooms, { foreignKey: 'room_id' });
  Messages.belongsTo(Users, { foreignKey: 'user_id' });

  Users.belongsToMany(Users, { as: 'User1', through: 'relationships', foreignKey: 'user1Id' });
  Users.belongsToMany(Users, { as: 'User2', through: 'relationships', foreignKey: 'user2Id' });

  db.sync({force: true})
    .then(function() {
      return Rooms.bulkCreate([
        { number_active_participants: 3 },
        { number_active_participants: 2 },
      ]);
    })
    .then(function(rooms) {
      return Users.bulkCreate([
        { facebook_id: 1234, first_name: 'Ash' },
        { facebook_id: 3456, first_name: 'Mo' },
        { facebook_id: 5678, first_name: 'Reina' },
      ])
      .then(function(users) {
        // console.log('USERS: ', users)
        // console.log('ROOMS: ', rooms)
        users.forEach((user) => { user.addRoom(rooms[0]); });
        users[0].addRoom(rooms[1]);
        users[1].addRoom(rooms[1]);
      });
    })
    .then(function() {
      return Users.findOne({ where: { first_name: 'Ash' } })
        .then(function(result) {
          return test(result.dataValues.id);
        });
    });
  //TODO: remove force true
};<commit_msg>create language and level storage objects<commit_after>module.exports = function() {
  var db = require('./db.js');
  var Users = require('./models/userModel.js');
  var Languages = require('./models/languageModel.js');
  var Levels = require('./models/levelModel.js');
  var LanguagesLevels = require('./models/languageLevelModel.js');
  var UsersLanguagesLevels = require('./models/userLanguageLevelModel.js');
  var Messages = require('./models/messageModel.js');
  var Rooms = require('./models/roomModel.js');
  var UserRooms = require('./models/userRoomModel.js');
  var Relationships = require('./models/relationshipModel.js');
  var test = require('./controllers/getRoomIdsAndUserIdsGivenSelfId.js')


  Languages.belongsToMany(Levels, { through: 'languages_levels', foreignKey: 'language_id' });
  Levels.belongsToMany(Languages, { through: 'languages_levels', foreignKey: 'level_id' });

  Users.belongsToMany(LanguagesLevels, { through: 'users_languages_levels', foreignKey: 'user_id' });
  LanguagesLevels.belongsToMany(Users, { through: 'users_languages_levels', foreignKey: 'language_level_id' });

  Users.belongsToMany(Rooms, { through: 'users_rooms', foreignKey: 'user_id' });
  Rooms.belongsToMany(Users, { through: 'users_rooms', foreignKey: 'room_id' });

  Messages.belongsTo(Rooms, { foreignKey: 'room_id' });
  Messages.belongsTo(Users, { foreignKey: 'user_id' });

  Users.belongsToMany(Users, { as: 'User1', through: 'relationships', foreignKey: 'user1Id' });
  Users.belongsToMany(Users, { as: 'User2', through: 'relationships', foreignKey: 'user2Id' });

  db.sync({force: true})
    .then(function() {
      return Rooms.bulkCreate([
        { number_active_participants: 3 },
        { number_active_participants: 2 },
      ]);
    })
    .then(function(rooms) {
      return Users.bulkCreate([
        { facebook_id: 1234, first_name: 'Ash' },
        { facebook_id: 3456, first_name: 'Mo' },
        { facebook_id: 5678, first_name: 'Reina' },
      ])
      .then(function(users) {
        // console.log('USERS: ', users)
        // console.log('ROOMS: ', rooms)
        users.forEach((user) => { user.addRoom(rooms[0]); });
        users[0].addRoom(rooms[1]);
        users[1].addRoom(rooms[1]);
  //TODO: remove force true
};
{'fraction_non_alphanumeric': 0.16854890262092478, 'fraction_numerical': 0.009801832516513957, 'mean_word_length': 4.052744886975242, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '612620', 'n_tokens_mistral': 1585, 'n_tokens_neox': 1501, 'n_words': 258}