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
Add [Index(nameof(SomeColumn))] to an entity class
Run dotnet ef migrations add NewMigration
Update ..._NewMigration.Designer.cs to include b.HasIndex("SomeColumn").IsCreatedConcurrently(true).HasDatabaseName("ix_some_column");
Run dotnet ef migrations script -o dbupdate.sql
Observe that there is still an SQL transaction, and CREATE INDEX does not include CONCURRENTLY
Update ...NewMigration.cs to include migrationBuilder.CreateIndex(...).Annotation("Npgsql:CreatedConcurrently", true);
Run dotnet ef migrations script -o dbupdate.sql
Observe that the SQL transaction is gone and it now includes CREATE INDEX CONCURRENTLY
The text was updated successfully, but these errors were encountered:
jonkelling
changed the title
Annotation("Npgsql:CreatedConcurrently", true) but IsCreatedConcurrently(true) does not
Annotation("Npgsql:CreatedConcurrently", true) works but IsCreatedConcurrently(true) does not
Feb 25, 2025
Tested with the following versions:
Steps to reproduce:
[Index(nameof(SomeColumn))]
to an entity classdotnet ef migrations add NewMigration
..._NewMigration.Designer.cs
to includeb.HasIndex("SomeColumn").IsCreatedConcurrently(true).HasDatabaseName("ix_some_column");
dotnet ef migrations script -o dbupdate.sql
CREATE INDEX
does not includeCONCURRENTLY
...NewMigration.cs
to includemigrationBuilder.CreateIndex(...).Annotation("Npgsql:CreatedConcurrently", true);
dotnet ef migrations script -o dbupdate.sql
CREATE INDEX CONCURRENTLY
The text was updated successfully, but these errors were encountered: