Open odyyudah opened 2 years ago
Since the schema is changing on the client side but not on the DB side, there is a mismatch and EF Core tries to query a column that doesn't exist in the DB yet. Either the DB has to be manually updated to add the new tables / columns, or we have to use migrations: https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/?tabs=dotnet-core-cli (although I'm not sure migrations will work with IndexedDB.SqliteStorage).
Added new properties to ToDo class and `public class Todo { [Key] public int Id { get; set; }
And modified ClientSideDbContext.cs `protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder);
The Exception is: An exception occurred while iterating over the results of a query for context type 'BlazorWasmSQLiteTest.ClientSideDbContext'. Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 1: 'no such column: t.Property1'. at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db) at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements(Stopwatch timer)+MoveNext() at Microsoft.Data.Sqlite.SqliteCommand.GetStatements(Stopwatch timer)+MoveNext() at Microsoft.Data.Sqlite.SqliteDataReader.NextResult() at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
I have to manually delete the IndexedDB.SqliteStorage using F12 then reload the page, only then application is running fine and no more EF exception. please advise, why does this happen whenever I added new properties?
thank you