Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
fix: use db config in app as well, not only for migration
Browse files Browse the repository at this point in the history
  • Loading branch information
achauve committed Nov 23, 2023
1 parent f363d12 commit 4da66e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/db/models/index.ts
Original file line number Diff line number Diff line change
@@ -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,
});

Expand Down
1 change: 0 additions & 1 deletion src/services/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4da66e7

Please sign in to comment.