Update stuff
This commit is contained in:
parent
0254e42b9c
commit
553ba9db9a
40 changed files with 7343 additions and 717 deletions
|
@ -3,12 +3,14 @@ import path from 'path';
|
|||
import Sequelize from 'sequelize';
|
||||
|
||||
import debugname from 'debug';
|
||||
|
||||
const debug = debugname('hostr:models');
|
||||
|
||||
const config = {
|
||||
dialect: 'postgres',
|
||||
protocol: 'postgres',
|
||||
logging: debug,
|
||||
quoteIdentifiers: true,
|
||||
logging: false,
|
||||
};
|
||||
|
||||
const sequelize = new Sequelize(process.env.DATABASE_URL, config);
|
||||
|
@ -16,7 +18,7 @@ const db = {};
|
|||
|
||||
fs
|
||||
.readdirSync(__dirname)
|
||||
.filter((file) => (file.indexOf('.') !== 0) && (file !== 'index.js'))
|
||||
.filter(file => (file.indexOf('.') !== 0) && (file !== 'index.js'))
|
||||
.forEach((file) => {
|
||||
const model = sequelize.import(path.join(__dirname, file));
|
||||
db[model.name] = model;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue