mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 15:17:23 +01:00
fix mysql retention query
This commit is contained in:
parent
a16b0cef3a
commit
495b7f1f20
2 changed files with 21 additions and 6 deletions
|
|
@ -43,7 +43,19 @@ function getDayDiffQuery(field1: string, field2: string): string {
|
|||
}
|
||||
|
||||
if (db === MYSQL) {
|
||||
return `DATEDIFF(${field1}, ${field2});`;
|
||||
return `DATEDIFF(${field1}, ${field2})`;
|
||||
}
|
||||
}
|
||||
|
||||
function getCastColumnQuery(field: string, type: string): string {
|
||||
const db = getDatabaseType(process.env.DATABASE_URL);
|
||||
|
||||
if (db === POSTGRESQL) {
|
||||
return `${field}::${type}`;
|
||||
}
|
||||
|
||||
if (db === MYSQL) {
|
||||
return `${field}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -206,6 +218,7 @@ export default {
|
|||
...prisma,
|
||||
getAddMinutesQuery,
|
||||
getDayDiffQuery,
|
||||
getCastColumnQuery,
|
||||
getDateQuery,
|
||||
getTimestampIntervalQuery,
|
||||
getFilterQuery,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue