PIbd-23_Dyakonov_R_R_SUBD_P.../server/db.ts

19 lines
537 B
TypeScript
Raw Normal View History

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";
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]
});