Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sequelize = require 'sequelize'
- class Database
- constructor: (@app) ->
- if process.env.NODE_ENV == 'production'
- cfg = @app.config.database.production
- else if process.env.NODE_ENV == 'test'
- cfg = @app.config.database.test
- else
- cfg = @app.config.database.development
- if @app.logger
- @app.logger.info 'Selected new database : %s.', cfg.database
- return instance: new Sequelize(
- cfg.database,
- cfg.username,
- cfg.password,
- logging: false
- dialect: cfg.dialect
- timezone: "+01:00"
- dialectOptions:
- charset: 'utf8mb4'
- define:
- timestamps: true
- charset: 'utf8',
- collate: 'utf8_general_ci',
- ),
- sequelize: Sequelize
- module.exports = Database
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement