Path: redb/redb.Tests.Integration/Tests/Sqlite/SqliteTypeMigrationTests.cs Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Tests.Integration/Tests/Sqlite/SqliteTypeMigrationTests.cs ---- using redb.Core; using redb.Tests.Integration.Fixtures; namespace redb.Tests.Integration.Tests.Sqlite; /// /// GitHub #5 — SQLite has no stored functions, so the base scheme-sync path that runs /// SELECT * FROM migrate_structure_type(...) failed with /// no such table: migrate_structure_type, taking down InitializeAsync on any property /// type change. now handles the migration /// in C#. These assert the missing-function crash is gone on both Free and Pro SQLite. /// public abstract class SqliteTypeMigrationTestsBase { protected readonly IRedbService Redb; protected SqliteTypeMigrationTestsBase(IRedbService redb) => Redb = redb; [Fact] public async Task MigrateStructureType_SameColumn_ReturnsResult_NotMissingTable() { // Int and Long both store in _Long — a no-op — but the old path emitted the missing SQL function // and threw "no such table: migrate_structure_type". var res = await Redb.MigrateStructureTypeAsync(999_999_999, "Int", "Long", dryRun: false); res.Should().NotBeNull(); res.AffectedRows.Should().Be(0); } [Fact] public async Task MigrateStructureType_CrossColumnNoData_ReturnsResult_NotMissingTable() { // String -> ListItem is a cross-column change, but with no values under this (non-existent) // structure there is nothing to move — must return cleanly, never hit the missing function. var res = await Redb.MigrateStructureTypeAsync(999_999_999, "String", "ListItem", dryRun: false); res.Should().NotBeNull(); res.AffectedRows.Should().Be(0); } } [Collection("Sqlite")] public class SqliteTypeMigrationTests : SqliteTypeMigrationTestsBase { public SqliteTypeMigrationTests(SqliteFixture fixture) : base(fixture.Redb) { } } [Collection("SqlitePro")] public class SqliteProTypeMigrationTests : SqliteTypeMigrationTestsBase { public SqliteProTypeMigrationTests(SqliteProFixture fixture) : base(fixture.Redb) { } }