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
I tried to use the NpgsqlAnnotationNames.IndexExpression but currently this annotation is not supported. Is it possbile to generate the following unique index with standard ef core fluent api:
CREATE UNIQUE INDEX i_nulltest ON "Com_User" (("UserName" IS NULL), ("DeletedDate" IS NULL))
WHERE "UserName" IS NULL OR "DeletedDate" IS NULL;
The text was updated successfully, but these errors were encountered:
If you're trying to use an index filter (WHERE clause), here are the docs:
modelBuilder.Entity<Blog>().HasIndex(b =>b.SomeInt).HasFilter(@"""SomeInt"" IS NOT NULL").IsUnique();
On the other hand, if you're trying to define an expression index, that isn't yet supported by the provider (#119 tracks this). But you can always use raw SQL in migrations to create expression indexes or anything else.
I tried to use the NpgsqlAnnotationNames.IndexExpression but currently this annotation is not supported. Is it possbile to generate the following unique index with standard ef core fluent api:
CREATE UNIQUE INDEX i_nulltest ON "Com_User" (("UserName" IS NULL), ("DeletedDate" IS NULL))
WHERE "UserName" IS NULL OR "DeletedDate" IS NULL;
The text was updated successfully, but these errors were encountered: