moved pragma statements into schema.sql

This commit is contained in:
2025-10-28 17:58:16 +01:00
parent 1057fd9954
commit a838ba44e8
3 changed files with 3833 additions and 19 deletions

View File

@@ -36,19 +36,6 @@ export async function initializeDatabase(): Promise<void> {
try {
console.log('Starting database initialization...');
// ✅ Set PRAGMA statements FIRST, before any transactions
await db.run('PRAGMA journal_mode = WAL;');
await db.run('PRAGMA synchronous = NORMAL;');
await db.run('PRAGMA foreign_keys = ON;');
await db.run('PRAGMA secure_delete = ON;');
await db.run('PRAGMA auto_vacuum = INCREMENTAL;');
// ❌ REMOVE this line - synchronous cannot be changed in transaction
// await db.run('PRAGMA synchronous = NORMAL;');
console.log('✅ Database PRAGMA settings configured');
try {
const existingAdmin = await db.get<{ count: number }>(