Laraue.EfCoreTriggers icon indicating copy to clipboard operation
Laraue.EfCoreTriggers copied to clipboard

Recreate triggers after SQLite table rebuild

Open berhir opened this issue 1 year ago • 0 comments

SQLite has limited support for schema changes and in many cases a table rebuild is required. EF Core does the table rebuilds automatically behind the scenes and it's not obvious when they are happening. EF assumes the domain/EF model fully represents the database schema. Triggers are not part of the model, and they get removed without any warning. See https://github.com/dotnet/EntityFramework.Docs/issues/4429 for more information.

It would be great to automatically detect if a table rebuild is required and add the CREATE TRIGGER statement to the migration if necessary.

berhir avatar Aug 04 '23 09:08 berhir