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
Hello, We are facing an issue where we are unable to convert the SearchVector annotation for NpgsqlTsVector to snake case.
We have enabled the default conversion of all tables and columns to lowercase (UseSnakeCaseNamingConvention), but when building the migration, the annotation is not converted to lowercase, so we had to explicitly specify uppercase for the SearchVector column so that the annotation references an existing column.
Can you suggest how to resolve this issue and convert everything to snake case?
ps
explicitly specifying a lowercase column name for a column via attribute or fluent api does not help
The text was updated successfully, but these errors were encountered:
@cmdRus please don't post screenshots when posting issues - a minimal, runnable console program (in actual code) which reproduces the error is what's needed when posting a bug report.
As an aside, having 11 colleagues thumbs-up an issue creates the false impression that many users are hitting this.
@roji I am attaching an example that reproduces the error. I apologize for the initially incorrectly formulated issue. The problem occurs when renaming a column, not when creating it TestTsVector.zip
usingMicrosoft.EntityFrameworkCore;usingMicrosoft.EntityFrameworkCore.Metadata.Internal;usingNpgsqlTypes;usingSystem.ComponentModel.DataAnnotations.Schema;[Table("search_entities")]publicclassSearchEntity{[Column("id")]publicintId{get;set;}[Column("search_string")]publicstringSearchString{get;set;}=null!;[Column("search_vector")]publicNpgsqlTsVectorSearchVector{get;set;}=null!;}publicclassDatabaseContext:DbContext{publicDbSet<SearchEntity>SearchEntities{get;set;}protectedoverridevoidOnConfiguring(DbContextOptionsBuilderoptionsBuilder){optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=test_ts_vector_local;Username=postgres;Password=postgres");}protectedoverridevoidOnModelCreating(ModelBuildermodelBuilder){modelBuilder.Entity<SearchEntity>(entity =>{entity.HasGeneratedTsVectorColumn(p =>p.SearchVector,"russian", p =>p.SearchString);entity.HasIndex(p =>p.SearchVector).HasMethod("GIN");});}}classProgramm{staticvoidMain(string[]args){usingvarcontext=newDatabaseContext();varcount=context.SearchEntities.Count();Console.WriteLine(count);Console.ReadLine();}}
Hello, We are facing an issue where we are unable to convert the SearchVector annotation for NpgsqlTsVector to snake case.



We have enabled the default conversion of all tables and columns to lowercase (UseSnakeCaseNamingConvention), but when building the migration, the annotation is not converted to lowercase, so we had to explicitly specify uppercase for the SearchVector column so that the annotation references an existing column.
Can you suggest how to resolve this issue and convert everything to snake case?
ps
explicitly specifying a lowercase column name for a column via attribute or fluent api does not help
The text was updated successfully, but these errors were encountered: