Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotation("Npgsql:CreatedConcurrently", true) works but IsCreatedConcurrently(true) does not #3473

Open
jonkelling opened this issue Feb 25, 2025 · 0 comments

Comments

@jonkelling
Copy link

Tested with the following versions:

    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.1">
    <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.3" />

Steps to reproduce:

  1. Add [Index(nameof(SomeColumn))] to an entity class
  2. Run dotnet ef migrations add NewMigration
  3. Update ..._NewMigration.Designer.cs to include b.HasIndex("SomeColumn").IsCreatedConcurrently(true).HasDatabaseName("ix_some_column");
  4. Run dotnet ef migrations script -o dbupdate.sql
  5. Observe that there is still an SQL transaction, and CREATE INDEX does not include CONCURRENTLY
  6. Update ...NewMigration.cs to include migrationBuilder.CreateIndex(...).Annotation("Npgsql:CreatedConcurrently", true);
  7. Run dotnet ef migrations script -o dbupdate.sql
  8. Observe that the SQL transaction is gone and it now includes CREATE INDEX CONCURRENTLY
@jonkelling 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant