<commit_before>var Sequelize = require('sequelize')


// var db = new Sequelize('postgres://teammerj:<EMAIL>jgirls@team<EMAIL>.ccfv<EMAIL>a.us-west-2.rds.amazonaws.com:5432/merjDB');
// db
//   .authenticate()
//   .then(function(err) {
//     console.log('Connection has been established successfully');
//   })
//   .catch(function (err) {
//     console.log('Unable to connect to the database', err);
//   })
//intialize sequelize with postgres remote url
if (process.env.DATABASE_URL) {
  var db = new Sequelize(process.env.DATABASE_URL, {dialect:'postgres', logging: false});
} else {
  var db = new Sequelize('merj', process.env.POSTGRES_USER, '', {dialect:'postgres', logging: false});
}

// create User table
var User = db.define('User', {
  username: Sequelize.STRING,
  email: Sequelize.STRING
  //id (auto-generated)
  //createdAt (auto-generated)
  //updatedAt (auto-generated)
});

// create Event table
var Event = db.define('Event', {
  location: Sequelize.STRING,
  date: Sequelize.DATE,
  title: Sequelize.STRING,
  time: Sequelize.STRING,
  category: Sequelize.STRING,
  description: Sequelize.STRING,
  image: Sequelize.TEXT,<commit_msg>changes<commit_after>require('dotenv').config();

var Sequelize = require('sequelize')


var db = new Sequelize('postgres://teammerj:<EMAIL>@<EMAIL>.us-west-2.rds.amazonaws.com:5432/merjDB');


//will change to env variables, but may need to direct require('dotenv').config() to correct location of .env file? not sure
//http://stackoverflow.com/questions/35356692/best-practice-when-using-an-api-key-in-node-js
// var db = new Sequelize('postgres://' + process.env.USERNAME + ':' + process.env.PASSWORD + '@<PASSWORD>sga.us-west-2.rds.amazonaws.com:5432/merjDB');

db
  .authenticate()
  .then(function(err) {
    console.log('Connection has been established successfully');
  })
  .catch(function (err) {
    console.log('Unable to connect to the database', err);
  });

// create User table
var User = db.define('User', {
  username: Sequelize.STRING,
  email: Sequelize.STRING
  //id (auto-generated)
  //createdAt (auto-generated)
  //updatedAt (auto-generated)
});

// create Event table
var Event = db.define('Event', {
  location: Sequelize.STRING,
  date: Sequelize.DATE,
  title: Sequelize.STRING,
  time: Sequelize.STRING,
  category: Sequelize.STRING,
  description: Sequelize.STRING,
  image: Sequelize.TEXT,
{'fraction_non_alphanumeric': 0.16196886832141355, 'fraction_numerical': 0.009676062263357174, 'mean_word_length': 4.1695652173913045, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6665183', 'n_tokens_mistral': 836, 'n_tokens_neox': 816, 'n_words': 171}