20 lines
592 B
TypeScript
20 lines
592 B
TypeScript
import dotenv from "dotenv";
|
|
import { Sequelize } from "sequelize-typescript";
|
|
import Role from "./models/role.model";
|
|
import User from "./models/user.model";
|
|
import Section from "./models/section.model";
|
|
import Thread from "./models/thread.model";
|
|
import Message from "./models/message.model";
|
|
|
|
dotenv.config();
|
|
|
|
export const sequelize = new Sequelize({
|
|
database: process.env.DB_NAME,
|
|
dialect: "postgres",
|
|
username: process.env.DB_USER,
|
|
password: process.env.DB_PASSWORD,
|
|
host: process.env.DB_HOST,
|
|
port: process.env.DB_PORT,
|
|
models: [Role, User, Section, Thread, Message]
|
|
});
|