const fs = require('fs');
const path = require('path');
const Sequelize = require('sequelize');
const config = require('../config');
const db = {};
const currentEnv = process.env.NODE_ENV || 'development';

var sequelize;

if (currentEnv === 'development') {
  sequelize = new Sequelize('postgres://localhost/blackmirror');
} else {
  sequelize = new Sequelize(`process.env.DATABASE_URL`);
}

fs.readdirSync(__dirname).filter(function (file) {
  return (file.indexOf('.') !== 0) && (file !== 'db.js');
}).forEach(function (file) {
  var model = sequelize['import'](path.join(__dirname, file));
  db[model.name] = model;
});

Object.keys(db).forEach(function (modelName) {
  if ('associate' in db[modelName]) {
    db[modelName].associate(db);
  }
});

db.sequelize = sequelize;
db.Sequelize = Sequelize;

module.exports = db;

@@ -354,17 +354,16 @@
 quelize(
-%60
 process.
@@ -382,9 +382,8 @@
 _URL
-%60
 );%0A%7D

Fix db url