diff --git a/src/db/models/index.ts b/src/db/models/index.ts index 062489d0..4b64aa71 100644 --- a/src/db/models/index.ts +++ b/src/db/models/index.ts @@ -1,13 +1,14 @@ import { Sequelize } from "sequelize"; +import dbConfig from "../config/config"; import config from "../../services/config"; import psychologist from "./psychologist"; -export const sequelize = new Sequelize(config.postgre.url, { +export const sequelize = new Sequelize(dbConfig.url, { + ...dbConfig, define: { freezeTableName: true, }, - dialect: "postgres", logging: config.postgre.logging ? console.log : false, }); diff --git a/src/services/config.ts b/src/services/config.ts index 9b53a547..c2e88574 100644 --- a/src/services/config.ts +++ b/src/services/config.ts @@ -43,7 +43,6 @@ export default { minScoreAddress: parseFloat(process.env.MIN_SCORE_ADDRESS || "0.30"), postgre: { logging: parseBoolean(process.env.DB_LOGGING_ENABLE), - url: process.env.DATABASE_URL || "postgres://localhost:5432/monpsysante", }, supportMail: process.env.SUPPORT_MAIL, reportingMailRecipients: process.env.REPORTING_MAIL_RECIPIENTS,