fix: SET PRAGMA foreign keys within the constructor

This commit is contained in:
2026-07-06 09:44:39 +05:30
parent 2657cb0ee4
commit fe164eb84c
2 changed files with 2 additions and 2 deletions

View File

@@ -7,8 +7,6 @@ const DB_PATH = path.resolve("/home/sortedcord/Projects/omnia_umbrella/omnia/omn
function getRepo() {
const db = new Database(DB_PATH);
// Enable foreign keys
db.exec("PRAGMA foreign_keys = ON;");
return { repo: new SQLiteRepository(db), db };
}

View File

@@ -9,6 +9,8 @@ export class SQLiteRepository {
constructor(db: Database.Database) {
this.db = db;
// Enable foreign keys for cascading deletes
this.db.exec("PRAGMA foreign_keys = ON;");
this.initializeSchema();
}