You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
972 B
JavaScript

const { Sequelize, DataTypes, Op } = require('sequelize');
/**
*
* 配置数据库
*
*/
const testDB = new Sequelize('hotel_hub', 'admin', 'admin', {
host: 'localhost',
dialect: 'mysql',
operatorsAliases: false,
dialectOptions: {
charset: 'utf8mb4',
collate: 'utf8mb4_unicode_ci',
supportBigNumbers: true,
bigNumberStrings: true,
},
pool: {
max: 5,
min: 0,
acquire: 30000,
idle: 10000,
},
timezone: '+08:00', //东八时区
});
const DB = new Sequelize('hotel_hub_p', 'admin', 'admin', {
host: 'localhost',
dialect: 'mysql',
operatorsAliases: false,
dialectOptions: {
charset: 'utf8mb4',
collate: 'utf8mb4_unicode_ci',
supportBigNumbers: true,
bigNumberStrings: true,
},
// logging: false,
pool: {
max: 5,
min: 0,
acquire: 30000,
idle: 10000,
},
timezone: '+08:00', //东八时区
});
module.exports = {
DataTypes, Op,
// sequelize: testDB,
sequelize: DB,
};