1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-24 21:39:36 +02:00

Server db utils changes

This commit is contained in:
Paweł Malak 2021-11-13 23:28:43 +01:00
parent 91e99e1bcc
commit d86ebe3e58
5 changed files with 36 additions and 21 deletions

View file

@ -1,12 +1,12 @@
const fs = require('fs');
const { slugify } = require('./slugify');
const backupDB = () => {
if (!fs.existsSync('data/db_backups')) {
fs.mkdirSync('data/db_backups');
}
const version = process.env.VERSION;
const slug = `db-${version.replace(/\./g, '')}-backup.sqlite`;
const slug = slugify();
const srcPath = 'data/db.sqlite';
const destPath = `data/db_backups/${slug}`;