From d0a0e305ee7a2dd319f863eb2c22a2aa122909e2 Mon Sep 17 00:00:00 2001 From: Eko Senjaya <1106036@sttgarut.ac.id> Date: Wed, 19 Jun 2024 08:54:35 +0700 Subject: [PATCH] improvement: add db timezone to env --- .env-backend-acme | 1 + .env-backend-cloudflare | 2 +- .env-backend-local | 1 + backend/src/config/database.ts | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.env-backend-acme b/.env-backend-acme index 0d1dbf54..c0b1e8b5 100644 --- a/.env-backend-acme +++ b/.env-backend-acme @@ -13,6 +13,7 @@ DB_HOST=postgres DB_PORT=5432 DB_USER=ticketz DB_NAME=ticketz +DB_TIMEZONE=-03:00 REDIS_URI=redis://redis:6379 diff --git a/.env-backend-cloudflare b/.env-backend-cloudflare index fd242d89..32e6d33b 100644 --- a/.env-backend-cloudflare +++ b/.env-backend-cloudflare @@ -9,7 +9,7 @@ DB_HOST=postgres DB_PORT=5432 DB_USER=ticketz DB_NAME=ticketz - +DB_TIMEZONE=-03:00 REDIS_URI=redis://redis:6379 REDIS_OPT_LIMITER_MAX=1 diff --git a/.env-backend-local b/.env-backend-local index 9248716a..850160f9 100644 --- a/.env-backend-local +++ b/.env-backend-local @@ -7,6 +7,7 @@ DB_HOST=postgres DB_PORT=5432 DB_USER=ticketz DB_NAME=ticketz +DB_TIMEZONE=-03:00 REDIS_URI=redis://redis:6379 diff --git a/backend/src/config/database.ts b/backend/src/config/database.ts index 39991796..6058c9b1 100644 --- a/backend/src/config/database.ts +++ b/backend/src/config/database.ts @@ -6,7 +6,7 @@ module.exports = { collate: "utf8mb4_bin" }, dialect: process.env.DB_DIALECT || "mysql", - timezone: "-03:00", + timezone: process.env.DB_TIMEZONE || "-03:00", host: process.env.DB_HOST, port: process.env.DB_PORT || 3306, database: process.env.DB_NAME,