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

25 lines
715 B

5 years ago
import {Sequelize} from 'sequelize-typescript';
import * as path from 'path'
import Chat from './ts/chat'
import Contact from './ts/contact'
import Invite from './ts/invite'
import Message from './ts/message'
import Subscription from './ts/subscription'
import MediaKey from './ts/mediaKey'
import ChatMember from './ts/chatMember'
5 years ago
const env = process.env.NODE_ENV || 'development';
const config = require(path.join(__dirname,'../../config/config.json'))[env]
5 years ago
const sequelize = new Sequelize({
...config,
logging: process.env.SQL_LOG==='true' ? console.log : false,
models: [Chat,Contact,Invite,Message,Subscription,MediaKey,ChatMember]
5 years ago
})
const models = sequelize.models
export {
sequelize,
models,
}