0
safi created
Hi
I have created a entity from abp suite and now wants to create non clustered indexes for some column so can you please suggest me how I can do this or need to do modification in migration file.
Thanks,
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
4 Answer(s)
-
1
Hi,
Open your
<YourProjectName>DbContextModelCreatingExtensions.csclass and useHasIndexto configure your entity.Example:
builder.Entity<MyTest>(b => { b.ToTable(qaConsts.DbTablePrefix + "MyTests", qaConsts.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Name).HasColumnName(nameof(MyTest.Name)); // add this // specify name as an index b.HasIndex(x => x.Name); });Use the
add-migration <migration file name>command to add migration file and run theDbMigratorproject apply migration.Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Can you share some screenshots?
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)