Commit Id and TimerStamps
This commit is contained in:
@ -1,10 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
||||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using isnd.Data;
|
||||
using isnd.Data.ApiKeys;
|
||||
using isnd.Data.Packages;
|
||||
|
||||
@ -22,6 +17,17 @@ namespace isnd.Data
|
||||
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
|
||||
: base(options) { }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder builder)
|
||||
{
|
||||
base.OnModelCreating(builder);
|
||||
_ = builder.Entity<PackageVersion>()
|
||||
.HasKey( v => new { v.PackageId, v.FullString } );
|
||||
_ = builder.Entity<PackageVersion>()
|
||||
.HasOne(v => v.Package).WithMany(p => p.Versions).HasForeignKey(x => x.PackageId);
|
||||
// _ = builder.Entity<Package>().HasMany(p => p.Versions).WithOne(V => V.Package).HasForeignKey(x => new { x.PackageId, x.FullString });
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// User API keys
|
||||
/// </summary>
|
||||
@ -33,7 +39,7 @@ namespace isnd.Data
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public DbSet<Package> Packages { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Package Versions
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user