Skip to content

Commit

Permalink
Fix: Disable timezone conversion for mariadb (louislam#3756)
Browse files Browse the repository at this point in the history
  • Loading branch information
chakflying authored Dec 2, 2023
1 parent 7772a54 commit 35479c7
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion server/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,14 @@ class Database {
user: dbConfig.username,
password: dbConfig.password,
database: dbConfig.dbName,
timezone: "+00:00",
timezone: "Z",
typeCast: function (field, next) {
if (field.type === "DATETIME") {
// Do not perform timezone conversion
return field.string();
}
return next();
},
},
pool: mariadbPoolConfig,
};
Expand All @@ -277,6 +284,14 @@ class Database {
socketPath: embeddedMariaDB.socketPath,
user: "node",
database: "kuma",
timezone: "Z",
typeCast: function (field, next) {
if (field.type === "DATETIME") {
// Do not perform timezone conversion
return field.string();
}
return next();
},
},
pool: mariadbPoolConfig,
};
Expand Down

0 comments on commit 35479c7

Please sign in to comment.