mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Detect when postgres is used instead of postgresql.
This commit is contained in:
parent
0db29719b0
commit
6833a5bdb0
3 changed files with 23 additions and 7 deletions
|
|
@ -4,10 +4,15 @@ import { subMinutes } from 'date-fns';
|
|||
import { MYSQL, POSTGRESQL, MYSQL_DATE_FORMATS, POSTGRESQL_DATE_FORMATS } from 'lib/constants';
|
||||
|
||||
export function getDatabase() {
|
||||
return (
|
||||
const type =
|
||||
process.env.DATABASE_TYPE ||
|
||||
(process.env.DATABASE_URL && process.env.DATABASE_URL.split(':')[0])
|
||||
);
|
||||
(process.env.DATABASE_URL && process.env.DATABASE_URL.split(':')[0]);
|
||||
|
||||
if (type === 'postgres') {
|
||||
return 'postgresql';
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
export function getDateQuery(db, field, unit, timezone) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue