1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24'use strict';
const authentication = require('./authentication');
const user = require('./user');
const Sequelize = require('sequelize');
module.exports = function() {
const app = this;
const sequelize = new Sequelize(app.get('mysql').conn, {
dialect: 'mysql',
logging: false,
define: {
charset: 'utf8',
collate: 'utf8_general_ci',
freezeTableName: true,
timestamps: true,
schema: app.get('mysql').prefix
}
});
app.set('sequelize', sequelize);
app.configure(authentication);
app.configure(user);
};