You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
namespaceMyApp.Migrations.ApplicationMigrations{[DbContext(typeof(ApplicationMigrationDbContext))]partialclassApplicationMigrationDbContextModelSnapshot:ModelSnapshot{protectedoverridevoidBuildModel(ModelBuildermodelBuilder){// FROM THISb.Property<List<PhoneContact>>("Phones").IsRequired().HasColumnType("jsonb");// TO THISb.Property<List<InitialCreate.PhoneContact>>("Phones").IsRequired().HasColumnType("jsonb");}}}
@roji This looks like an Npgsql-specific issue where the collection type is included in the snapshot because it is mapped as a primitive type by PostgreSQL.
@bricelam Can you check that we're not putting user CLR types in migrations for primitive collections (or complex types) when using SQL Server/SQLite?
I have a project that has a
Contact
entity like thisThe generated migration is doing this
I want to drop the
Phones
column from myContact
entity and I want to delete thePhoneContact
class that is not used anymore.The problem is that old migrations are using this class and the project does not want to compile anymore because I deleted it.
What would be the best way to handle this case without destroying all migrations?
Include provider and version information
EF Core version:
Database provider: Npgsql
Target framework: .NET 7.0
Operating system: Windows 11 / WSL 2
IDE: Rider
The text was updated successfully, but these errors were encountered: