Reputation: 8047
I use npqsql 4+ and efcore 2.1+, how I can create unique invariant case insensetive constraint on field?
The following construction doesn't work:
modelBuilder.Entity<Company>().HasAlternateKey(city => city.Name.ToUpperInvariant());
Upvotes: 4
Views: 1662
Reputation: 118937
Unfortunately, there doesn't appear to be a way to create an index with a specific collation using the Npgsql driver. The only PostgreSQL specific configuration that can be done on an index is to set the method using the ForNpgsqlHasMethod
extension. You have
a couple of options:
Upvotes: 3