cnc-speed-calculator/sequelize/index.js

22 lines
574 B
JavaScript
Raw Normal View History

2021-01-27 23:36:51 +01:00
const { Sequelize } = require('sequelize');
const logger = require('../config/winston')
const sequelize = new Sequelize({
dialect: 'sqlite',
storage: 'db.sqlite',
logQueryParameters: true,
benchmark: true,
logging: msg => logger.debug.bind(msg)
});
const modelDefiners = [
require('./models/preset-cut.model'),
require('./models/preset-step-down-factor.model'),
2021-01-28 01:30:55 +01:00
require('./models/need-init.model'),
require('./models/user.model')
2021-01-27 23:36:51 +01:00
];
for (const modelDefiner of modelDefiners) {
modelDefiner(sequelize);
}
module.exports = sequelize;