public async Task TableModificationsWork() { var filename = Path.GetTempFileName(); var uri = new UriBuilder(filename) { Query = "?mode=rwc" }.Uri.ToString(); Assert.StartsWith("file://", uri); try { JObject table = new() { { "id", string.Empty }, { "stringValue", string.Empty } }; // Create the first store var store1 = new OfflineSQLiteStore(uri); store1.DefineTable(TestTable, table); await store1.InitializeAsync(); var results1 = await store1.ExecuteQueryAsync(new JObject(), $"PRAGMA table_info({TestTable})"); // Do Assertions here Assert.Equal(table.Properties().Count(), results1.Count); foreach (var prop in table.Properties()) { Assert.Contains(prop.Name, results1.Select(o => o.Value <string>("name"))); } // Clean up store1.DbConnection.connection.Close(); // Create the second store. table["addedColumn"] = string.Empty; var store2 = new OfflineSQLiteStore(uri); store2.DefineTable(TestTable, table); await store2.InitializeAsync(); var results2 = await store2.ExecuteQueryAsync(new JObject(), $"PRAGMA table_info({TestTable})"); // Do Assertions here Assert.Equal(table.Properties().Count(), results2.Count); foreach (var prop in table.Properties()) { Assert.Contains(prop.Name, results2.Select(o => o.Value <string>("name"))); } // Clean up store2.DbConnection.connection.Close(); // Create the first store table.Remove("stringValue"); var store3 = new OfflineSQLiteStore(uri); store3.DefineTable(TestTable, table); await store3.InitializeAsync(); var results3 = await store3.ExecuteQueryAsync(new JObject(), $"PRAGMA table_info({TestTable})"); // Do Assertions here Assert.Equal(table.Properties().Count(), results3.Count); foreach (var prop in table.Properties()) { Assert.Contains(prop.Name, results3.Select(o => o.Value <string>("name"))); } // Clean up store3.DbConnection.connection.Close(); }