Skip to content

Upgrade guide: a derived SQLite generator replaced unkeyed is refused too; the sentence says only a non-derived one is #153

Closed

Description

@CaffeinatedCoder

Found in the 5.5.0 pre-tag review (#36).

docs/upgrading.md, "Tables SQLite rebuilds", says:

migrations add still refuses when UseComplexIndexes() is called before UseSqlite(), or when another package replaces IMigrationsSqlGenerator with a generator that does not derive from SQLite's, since EF Core keeps only one replacement.

Whether the generator derives from SQLite's does not decide it. What decides it is whether the ReplaceService call is keyed on SQLite's generator.

Reproduction

SqliteTableRebuildTests.Replaced_generator_is_refused already shows it. AuditingGenerator derives from SqliteMigrationsSqlGenerator, and both of these are refused, naming AuditingGenerator:

builder.UseComplexIndexes().ReplaceService<IMigrationsSqlGenerator, AuditingGenerator>();
builder.ReplaceService<IMigrationsSqlGenerator, AuditingGenerator>().UseComplexIndexes();

The keyed form ReplaceService<IMigrationsSqlGenerator, SqliteMigrationsSqlGenerator, AuditingGenerator>() is wrapped and works.

A reader whose generator derives from SQLite's concludes from the sentence that they are fine, then meets the refusal.

Proposed fix

Reword the sentence to something like: "…or when another package replaces IMigrationsSqlGenerator without naming SQLite's generator as the one it replaces (an unkeyed ReplaceService<IMigrationsSqlGenerator, T>()), since EF Core keeps only one replacement."

Optionally, have the refusal message suggest the keyed ReplaceService<IMigrationsSqlGenerator, SqliteMigrationsSqlGenerator, T>().

Activity

  1. added this to the 5.5.0 milestone on Oct 20, 2026
  2. added
    documentation
    package/core
    area/migrations
    on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/migrationsdocumentationpackage/core

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions