mirror of
https://github.com/donpat1to/Schichtenplaner.git
synced 2025-12-01 06:55:45 +01:00
moved pragma statements into schema.sql
This commit is contained in:
@@ -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 }>(
|
||||
|
||||
Reference in New Issue
Block a user