Masterchoc

Untitled

Jan 27th, 2018
570
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sequelize = require 'sequelize'
  2.  
  3. class Database
  4.     constructor: (@app) ->
  5.         if process.env.NODE_ENV == 'production'
  6.             cfg = @app.config.database.production
  7.         else if process.env.NODE_ENV == 'test'
  8.             cfg = @app.config.database.test
  9.         else
  10.             cfg = @app.config.database.development
  11.  
  12.         if @app.logger
  13.             @app.logger.info 'Selected new database : %s.', cfg.database
  14.  
  15.         return instance: new Sequelize(
  16.             cfg.database,
  17.             cfg.username,
  18.             cfg.password,
  19.             logging: false
  20.             dialect: cfg.dialect
  21.             timezone: "+01:00"
  22.             dialectOptions:
  23.                 charset: 'utf8mb4'
  24.             define:
  25.                 timestamps: true
  26.                 charset: 'utf8',
  27.                 collate: 'utf8_general_ci',
  28.         ),
  29.         sequelize: Sequelize
  30.  
  31. module.exports = Database
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×