<commit_before>var sqlite3 = require('sqlite3'),
    db = new sqlite3.Database('./donut_database.sqlite3');

// Create the database schema and populate
db.serialize(function() {
  // Create the users table.
  //
  // COLUMNS:
  // userID INTEGER PRIMARY KEY -- An int generated by SQL.
  // real_name TEXT -- Full name, e.g. "<NAME>"
  // phone_number TEXT -- Phone number as text, e.g. "9135555555"
  // email_address TEXT -- Email address as text. MAKE toLowerCase().
  // username_text TEXT -- Username (can be independent of realname). Probably shouldn't contain spaces.
  // password TEXT -- Encrypted password as text.
  // organization TEXT -- Name of the organization that the user is a part of.
  // donut_quality_rating REAL -- Quality of the donuts on a scale of 1 to 10 (floating point number).
  // donut_reliability_rating REAL -- Reliability of the user, as a real number from 0 to 100 (expressed as a precentage).
  // has_rated_this_week INTEGER -- Bool, 0 if false or 1 if true. Has this user rated the donut baron for the week?
  // is_donut_baron INTEGER -- Bool, 0 if false or 1 if true. Has the user rated this week's donut baron?
  // is_admin INTEGER) -- Bool, 0 if false or 1 if true. Is the user an admin?
  db.run("CREATE TABLE users (userID INTEGER PRIMARY KEY, real_name TEXT, phone_number TEXT, email_address TEXT, username_text TEXT, password TEXT, organization TEXT, donut_quality_rating REAL, donut_reliability_rating REAL, has_rated_this_week INTEGER, is_donut_baron INTEGER, is_admin INTEGER)");

  // Create the userList table. It Holds a chronooglical list of users, with the dates in which they will become the donut baron.
  //
  // listID INTEGER PRIMARY KEY -- Primary key for the table. Probably arbitrary.
  // date TEXT -- Date in which the user will become the donut baron, expressed as 'YYYY-MM-DD'.
  // userID INTEGER -- The userID of the assocated user. References users table.
  // FOREIGN KEY(userID) REFERENCES users(userID)) -- See above.
  db.run("CREATE TABLE userList (listID INTEGER PRIMARY KEY, date TEXT, userID INTEGER, FOREIGN KEY(userID) REFERENCES users(userID))");

  // Create the comments table.
  //
  // commentID INTEGER PRIMARY KEY -- Arbitary primary key integer for each comment.
  // comment_content TEXT -- The actual textual content of each comment.
  // username TEXT - The username of the user that made the comment.
  // time_stamp INTEGER -- The time that the comment was posted. Format TBD.
  db.run("CREATE TABLE comments (commentID INTEGER PRIMARY KEY, comment_content TEXT, username TEXT, time_stamp INTEGER, isAdmin INTEGER)");

  // Add two sample posts.
  db.run("INSERT INTO pages (page_name, main_content_markdown) VALUES ('CIS 526 Information', 'CIS 526 is the *greatest class that has ever been taught*.')");
  db.run("INSERT INTO pages (page_name, main_content_markdown) VALUES ('Dogs', '**Dogs are the best.** Do you have a dog? Well you should. All hail the glow cloud.')");
  // Give each of those sample posts two comments.
  db.run("INSERT INTO comments (comment, associated_page) VALUES ('LOL this wiki is incredible!', 1)");
  db.run("INSERT INTO comments (comment, associated_page) VALUES ('This wiki is terrible, it needs major edits!', 1)");
  db.run("INSERT INTO comments (comment, associated_page) VALUES ('Who wrote this garbage?', 2)");
  db.run("INSERT INTO comments (comment, associated_page) VALUES ('This is awful, I am quiting the Internet.', 2)");

  //Create some users (there will be no way to add additional users in the inital application).
  db.run("INSERT INTO users (username, password, isBanned, isAdmin) VALUES ('admin1', '0000', 0, 1)");
  db.run("INSERT INTO users (username, password, isBanned, isAdmin) VALUES ('admin2', '0000', 0, 1)");
  db.run("INSERT INTO users (username, password, isBanned, isAdmin) VALUES ('bob', '<PASSWORD>', 0, 0)");
  db.run("INSERT INTO users (username, password, isBanned, isAdmin) VALUES ('christian', '<PASSWORD>', 0, 0)");
  db.run("INSERT INTO users (username, password, isBanned, isAdmin) VALUES ('bannedGuy', '<PASSWORD>', 1, 0)");
});<commit_msg>Add sample users to database.<commit_after>var sqlite3 = require('sqlite3'),
    db = new sqlite3.Database('./donut_database.sqlite3');

// Create the database schema and populate
db.serialize(function() {
  // Create the users table.
  //
  // COLUMNS:
  // userID INTEGER PRIMARY KEY -- An int generated by SQL.
  // real_name TEXT -- Full name, e.g. "<NAME>"
  // phone_number TEXT -- Phone number as text, e.g. "9135555555"
  // email_address TEXT -- Email address as text. MAKE toLowerCase().
  // username_text TEXT -- Username (can be independent of realname). Probably shouldn't contain spaces.
  // password TEXT -- Encrypted password as text.
  // organization TEXT -- Name of the organization that the user is a part of.
  // donut_quality_rating REAL -- Quality of the donuts on a scale of 1 to 10 (floating point number).
  // donut_reliability_rating REAL -- Reliability of the user, as a real number from 0 to 100 (expressed as a precentage).
  // has_rated_this_week INTEGER -- Bool, 0 if false or 1 if true. Has this user rated the donut baron for the week?
  // is_donut_baron INTEGER -- Bool, 0 if false or 1 if true. Has the user rated this week's donut baron?
  // is_admin INTEGER) -- Bool, 0 if false or 1 if true. Is the user an admin?
  db.run("CREATE TABLE users (userID INTEGER PRIMARY KEY, real_name TEXT, phone_number TEXT, email_address TEXT, username_text TEXT, password TEXT, organization TEXT, donut_quality_rating REAL, donut_reliability_rating REAL, has_rated_this_week INTEGER, is_donut_baron INTEGER, is_admin INTEGER)");

  // Create the userList table. It Holds a chronooglical list of users, with the dates in which they will become the donut baron.
  //
  // listID INTEGER PRIMARY KEY -- Primary key for the table. Probably arbitrary.
  // date TEXT -- Date in which the user will become the donut baron, expressed as 'YYYY-MM-DD'.
  // userID INTEGER -- The userID of the assocated user. References users table.
  // FOREIGN KEY(userID) REFERENCES users(userID)) -- See above.
  db.run("CREATE TABLE userList (listID INTEGER PRIMARY KEY, date TEXT, userID INTEGER, FOREIGN KEY(userID) REFERENCES users(userID))");

  // Create the comments table.
  //
  // commentID INTEGER PRIMARY KEY -- Arbitary primary key integer for each comment.
  // comment_content TEXT -- The actual textual content of each comment.
  // username TEXT - The username of the user that made the comment.
  // time_stamp INTEGER -- The time that the comment was posted. Format TBD.
  db.run("CREATE TABLE comments (commentID INTEGER PRIMARY KEY, comment_content TEXT, username TEXT, time_stamp INTEGER, isAdmin INTEGER)");

  // Add three sample users.
  db.run("INSERT INTO users (real_name, phone_number, email_address, username_text, password, organization, donut_quality_rating, donut_reliability_rating, has_rated_this_week, is_donut_baron, is_admin)"
       + "VALUES ('<NAME>', '9139081592', '<EMAIL>', 'cjhughes255', '<PASSWORD>', 'KSU', '10', '100', '0', '1', '1')");
  db.run("INSERT INTO users (real_name, phone_number, email_address, username_text, password, organization, donut_quality_rating, donut_reliability_rating, has_rated_this_week, is_donut_baron, is_admin)"
      + "VALUES ('<NAME>', '6208754366', '<EMAIL>', 'seiwerta', '<PASSWORD>', 'KSU', '7', '70', '0', '0', '1')");
  db.run("INSERT INTO users (real_name, phone_number, email_address, username_text, password, organization, donut_quality_rating, donut_reliability_rating, has_rated_this_week, is_donut_baron, is_admin)"
      + "VALUES ('<NAME>', '9139081592', '<EMAIL>', 'apfangman', '<PASSWORD>', 'KSU', '2', '20', '1', '0', '1')");

       // Give each of those sample posts two comments.
  db.run("INSERT INTO comments (comment, associated_page) VALUES ('LOL this wiki is incredible!', 1)");
  db.run("INSERT INTO comments (comment, associated_page) VALUES ('This wiki is terrible, it needs major edits!', 1)");
  db.run("INSERT INTO comments (comment, associated_page) VALUES ('Who wrote this garbage?', 2)");
  db.run("INSERT INTO comments (comment, associated_page) VALUES ('This is awful, I am quiting the Internet.', 2)");

  //Create some users (there will be no way to add additional users in the inital application).
  db.run("INSERT INTO users (username, password, isBanned, isAdmin) VALUES ('admin1', '0000', 0, 1)");
  db.run("INSERT INTO users (username, password, isBanned, isAdmin) VALUES ('admin2', '0000', 0, 1)");
  db.run("INSERT INTO users (username, password, isBanned, isAdmin) VALUES ('bob', '<PASSWORD>', 0, 0)");
  db.run("INSERT INTO users (username, password, isBanned, isAdmin) VALUES ('christian', '1111', 0, 0)");
  db.run("INSERT INTO users (username, password, isBanned, isAdmin) VALUES ('bannedGuy', '1111', 1, 0)");
});
{'fraction_non_alphanumeric': 0.11908793317530195, 'fraction_numerical': 0.01907664521955074, 'mean_word_length': 4.112521638776688, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '4070604', 'n_tokens_mistral': 2874, 'n_tokens_neox': 2605, 'n_words': 1082}