mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 15:47:13 +01:00
Added database check.
This commit is contained in:
parent
3122bab419
commit
ac3017b2e4
6 changed files with 104 additions and 40 deletions
|
|
@ -2,7 +2,7 @@ require('dotenv').config();
|
|||
const fse = require('fs-extra');
|
||||
const path = require('path');
|
||||
|
||||
function getDatabase() {
|
||||
function getDatabaseType() {
|
||||
const type =
|
||||
process.env.DATABASE_TYPE ||
|
||||
(process.env.DATABASE_URL && process.env.DATABASE_URL.split(':')[0]);
|
||||
|
|
@ -14,7 +14,7 @@ function getDatabase() {
|
|||
return type;
|
||||
}
|
||||
|
||||
const databaseType = getDatabase();
|
||||
const databaseType = getDatabaseType();
|
||||
|
||||
if (!databaseType || !['mysql', 'postgresql'].includes(databaseType)) {
|
||||
throw new Error('Missing or invalid database');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue