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.
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.