mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-10-14 03:28:14 +00:00
feat(migrator): use DATA_DIR
env var
This commit is contained in:
@@ -2,9 +2,12 @@ import Database from 'better-sqlite3';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
|
||||||
const db = new Database(path.join(process.cwd(), 'data', 'db.sqlite'));
|
const DATA_DIR = process.env.DATA_DIR || process.cwd();
|
||||||
|
const dbPath = path.join(DATA_DIR, './data/db.sqlite');
|
||||||
|
|
||||||
const migrationsFolder = path.join(process.cwd(), 'drizzle');
|
const db = new Database(dbPath);
|
||||||
|
|
||||||
|
const migrationsFolder = path.join(DATA_DIR, 'drizzle');
|
||||||
|
|
||||||
db.exec(`
|
db.exec(`
|
||||||
CREATE TABLE IF NOT EXISTS ran_migrations (
|
CREATE TABLE IF NOT EXISTS ran_migrations (
|
||||||
|
Reference in New Issue
Block a user