var Sequelize = require("sequelize");
var db = new Sequelize("d85rqkr8v6isif", "cyovufgurynjkv", "5Ngw22AyNMlJMGkO2XFqOnt2pG", {
  host: 'ec2-54-225-197-30.compute-1.amazonaws.com',
  dialect: 'postgres'
});


// we define the models we need using js--we don't need a schema file!
var User = db.define('User', {
  google_id: Sequelize.STRING,
  google_token: Sequelize.STRING,
  facebook_id: Sequelize.STRING,
  facebook_token: Sequelize.STRING
});

// puts a UserId column on each Message instance
// also gives us the `.setUser` method, available inside the .success callback
// after creating a new instance of Message
// Message.belongsTo(User);
// enables bi-directional associations between Users and Messages
// User.hasMany(Message);


User.sync()
  .then(function() {
    console.log('User Table has is definitely in our Postgres Database');
  });
// creates these tables in MySQL if they don't already exist. Pass in {force: true}
// to drop any existing user and message tables and make new ones.


var Board = db.define('Board', {
  thing: Sequelize.BLOB
});

Board.sync()
  .then(function() {
    console.log('Board Table has is definitely in our Postgres Database');
  });


module.exports = {
  User: User,
  Board: Board
}


@@ -35,16 +35,44 @@
 %22);%0Avar 
+db;%0Aif(process.env.PORT)%7B%0A  
 db = new
@@ -150,16 +150,18 @@
 2pG%22, %7B%0A
+  
   host: 
@@ -205,16 +205,18 @@
 s.com',%0A
+  
   dialec
@@ -229,20 +229,127 @@
 stgres'%0A
+  
 %7D);%0A
+%7D else %7B%0A  db = new Sequelize(%22board%22, %22%22, %22%22, %7B%0A    host: 'localhost',%0A    dialect: 'postgres'%0A  %7D);%0A%0A%7D%0A
 %0A%0A// we 

make database work on both local and deployed