mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
19 lines
444 B
JavaScript
19 lines
444 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');
|
|
}
|
|
|
|
console.log(`Database detected: ${db}`);
|
|
|
|
const src = path.resolve(__dirname, `../prisma/schema.${db}.prisma`);
|
|
const dest = path.resolve(__dirname, '../prisma/schema.prisma');
|
|
|
|
fs.copyFileSync(src, dest);
|
|
|
|
console.log(`Copied ${src} to ${dest}`);
|