fix: corrupted data
This commit is contained in:
parent
2c8f863a49
commit
3ebe864b89
1 changed files with 2 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ import { open } from 'sqlite';
|
||||||
import sqlite3 from 'sqlite3';
|
import sqlite3 from 'sqlite3';
|
||||||
import { initialPrompts } from './data';
|
import { initialPrompts } from './data';
|
||||||
import { hash } from 'bcryptjs';
|
import { hash } from 'bcryptjs';
|
||||||
|
import path from 'path';
|
||||||
|
|
||||||
// Singleton pattern to ensure only one database connection is created.
|
// Singleton pattern to ensure only one database connection is created.
|
||||||
let db: Awaited<ReturnType<typeof open>> | null = null;
|
let db: Awaited<ReturnType<typeof open>> | null = null;
|
||||||
|
|
@ -36,7 +37,7 @@ export async function getDb() {
|
||||||
await setupAdminPassword();
|
await setupAdminPassword();
|
||||||
|
|
||||||
const newDb = await open({
|
const newDb = await open({
|
||||||
filename: './database.db',
|
filename: path.join(process.cwd(), 'database.db'),
|
||||||
driver: sqlite3.Database,
|
driver: sqlite3.Database,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue