From 05b9f74d06e7134afb74208468e813364a0a6a66 Mon Sep 17 00:00:00 2001 From: Adrien Chauve Date: Thu, 23 Nov 2023 12:47:47 +0100 Subject: [PATCH] fix --- src/db/models/index.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/db/models/index.ts b/src/db/models/index.ts index 4b64aa71..07b4c9b7 100644 --- a/src/db/models/index.ts +++ b/src/db/models/index.ts @@ -4,13 +4,16 @@ import dbConfig from "../config/config"; import config from "../../services/config"; import psychologist from "./psychologist"; -export const sequelize = new Sequelize(dbConfig.url, { - ...dbConfig, - define: { - freezeTableName: true, - }, - logging: config.postgre.logging ? console.log : false, -}); +export const sequelize = new Sequelize( + dbConfig.url || "postgres://localhost:5432/monpsysante", + { + ...dbConfig, + define: { + freezeTableName: true, + }, + logging: config.postgre.logging ? console.log : false, + } +); export const models = { Psychologist: psychologist(sequelize),