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:
parent
91e99e1bcc
commit
d86ebe3e58
5 changed files with 36 additions and 21 deletions
|
@ -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}`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue