fix(data): enable foreign_keys pragma in MigrateAndConfigure

This commit is contained in:
mika kuns
2026-04-23 18:15:06 +02:00
parent 19bf032a2e
commit 782110604b

View File

@@ -45,6 +45,13 @@ public class ClaudeDoDbContext : DbContext
walCmd.ExecuteNonQuery();
}
// Enable FK enforcement — SQLite defaults to OFF per connection.
using (var fkCmd = conn.CreateCommand())
{
fkCmd.CommandText = "PRAGMA foreign_keys=ON;";
fkCmd.ExecuteNonQuery();
}
// If the 'lists' table exists but __EFMigrationsHistory does not,
// this is a pre-EF database. Baseline the InitialCreate migration.
using (var cmd = conn.CreateCommand())