mirror of
https://github.com/kremalicious/umami.git
synced 2024-06-30 13:41:50 +02:00
15 lines
360 B
JavaScript
15 lines
360 B
JavaScript
|
require('dotenv').config();
|
||
|
const fs = require('fs');
|
||
|
const path = require('path');
|
||
|
|
||
|
const db = process.env.DATABASE_URL.split(':')[0];
|
||
|
|
||
|
if (!db) {
|
||
|
throw new Error('Database not specified');
|
||
|
}
|
||
|
|
||
|
const src = path.resolve(__dirname, `../prisma/schema.${db}.prisma`);
|
||
|
const dest = path.resolve(__dirname, '../prisma/schema.prisma');
|
||
|
|
||
|
fs.copyFileSync(src, dest);
|