update getDatabase to lookup DATABASE_TYPE env

This commit is contained in:
HipsterBrown 2020-08-26 20:50:47 -04:00
parent 3e1bc27f26
commit ef8da2fbcc

View File

@ -6,7 +6,7 @@ const POSTGRESQL = 'postgresql';
const MYSQL = 'mysql'; const MYSQL = 'mysql';
export function getDatabase() { export function getDatabase() {
return process.env.DATABASE_URL.split(':')[0]; return process.env.DATABASE_TYPE || process.env.DATABASE_URL.split(':')[0];
} }
export async function getWebsiteById(website_id) { export async function getWebsiteById(website_id) {