From cf67fd9bb3c3156f99e4ab1e752ac06b7259e3aa Mon Sep 17 00:00:00 2001
From: Eduardo Mathias <ems19@inf.ufpr.br>
Date: Fri, 1 Sep 2023 09:28:54 -0300
Subject: [PATCH] [ADD] New Postgres connection

---
 src/libs/db/postgres.js | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/src/libs/db/postgres.js b/src/libs/db/postgres.js
index 2e16df38..f63f95b7 100644
--- a/src/libs/db/postgres.js
+++ b/src/libs/db/postgres.js
@@ -1,7 +1,22 @@
 const Sequelize = require('sequelize');
 
-const DATABASE_URL = 'postgres://postgres:postgres@localhost:5432/postgres'
+const dbConfig = {
+    database: 'simcaq_adm',
+    username: 'simcaq',
+    password: 'simcaq',
+    host: '200.17.202.97', 
+    port: 5432,        
+    dialect: 'postgres',
+  };
 
-const db = new Sequelize(DATABASE_URL)
+const db = new Sequelize(dbConfig)
+
+db.authenticate()
+    .then(() => {
+      console.log('Connection has been established successfully.');
+    })
+    .catch((err) => {
+      console.error('Unable to connect to the database:', err);
+    });
 
 module.exports = db
\ No newline at end of file
-- 
GitLab