Skip to content

Commit

Permalink
Add vulnerabilities service
Browse files Browse the repository at this point in the history
  • Loading branch information
drewgillies committed Dec 17, 2020
1 parent ec2c439 commit 91e8d13
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/NuGetGallery.Core/Entities/EntitiesContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,13 @@ protected override void OnModelCreating(DbModelBuilder modelBuilder)
.HasIndex(pv => new { pv.VulnerabilityKey, pv.PackageId, pv.PackageVersionRange })
.IsUnique();

modelBuilder.Entity<VulnerablePackageVersionRange>()
.HasMany<Package>(vpvr => vpvr.Packages)
.WithMany(p => p.VulnerablePackageRanges)
.Map(c => c.ToTable("VulnerablePackageVersionRangePackages")
.MapLeftKey("VulnerablePackageVersionRange_Key")
.MapRightKey("Package_Key"));

modelBuilder.Entity<PackageRename>()
.HasKey(r => r.Key)
.HasIndex(r => r.TransferPopularity);
Expand Down

0 comments on commit 91e8d13

Please sign in to comment.