Search code examples
c#postgresqlnpgsqlef-code-first-mapping

IndexBuilder and ForNpgsqlHasComment


Why NpgsqlEntityTypeBuilderExtensions and NpgsqlPropertyBuilderExtensions has ForNpgsqlHasComment method to set Comment, but NpgsqlIndexBuilderExtensions doesn't. How to set Comment for Index in FluentApi?


Solution

  • This isn't currently supported. You can open an issue requesting this on https://github.com/aspnet/EntityFrameworkCore/ (comment support has no been added to EF Core itself and will no longer be Npgsql-specific).

    In the meantime you can use raw SQL in migrations to add comments to your indexes manually.