dependencies
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using isn.abst;
|
using isn.abst;
|
||||||
@ -8,6 +9,7 @@ using isnd.Entities;
|
|||||||
using isnd.Helpers;
|
using isnd.Helpers;
|
||||||
using isnd.ViewModels;
|
using isnd.ViewModels;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Components.Web.Virtualization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
@ -20,12 +22,22 @@ namespace isnd.Controllers
|
|||||||
public async Task<IActionResult> Index(PackageRegistrationQuery model)
|
public async Task<IActionResult> Index(PackageRegistrationQuery model)
|
||||||
{
|
{
|
||||||
var pkgs = await packageManager.SearchPackageAsync(model);
|
var pkgs = await packageManager.SearchPackageAsync(model);
|
||||||
|
var result = new RegistrationPageIndexQueryAndResult
|
||||||
|
{
|
||||||
|
Source = packageManager.CatalogBaseUrl+ApiConfig.Index,
|
||||||
|
Query = model
|
||||||
|
};
|
||||||
|
List<PackageRegistration> registrations = new List<PackageRegistration>();
|
||||||
|
foreach (var pk in pkgs.data.GroupBy(x => x.PackageId))
|
||||||
|
{
|
||||||
|
registrations.Add(new PackageRegistration(apiBase, pk.Key, pkgs.GetResults().Single(p=>p.Id == pk.Key).Versions));
|
||||||
|
}
|
||||||
|
|
||||||
return View(new RegistrationPageIndexQueryAndResult
|
return View(new RegistrationPageIndexQueryAndResult
|
||||||
{
|
{
|
||||||
Source = packageManager.CatalogBaseUrl+ApiConfig.Index,
|
Source = packageManager.CatalogBaseUrl+ApiConfig.Index,
|
||||||
Query = model,
|
Query = model,
|
||||||
Result = pkgs.GetResults().Select(p => new PackageRegistration(apiBase, p)).ToArray()
|
Result = registrations.ToArray()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using isnd.Data.ApiKeys;
|
using isnd.Data.ApiKeys;
|
||||||
using isnd.Data.Packages;
|
using isnd.Data.Packages;
|
||||||
|
using Microsoft.VisualStudio.Web.CodeGenerators.Mvc.Templates.BlazorIdentity.Pages;
|
||||||
|
using Microsoft.DotNet.Scaffolding.Shared.ProjectModel;
|
||||||
|
|
||||||
namespace isnd.Data
|
namespace isnd.Data
|
||||||
{
|
{
|
||||||
@ -29,6 +31,9 @@ namespace isnd.Data
|
|||||||
_ = builder.Entity<PackageDependencyGroup>().HasOne(g=>g.PackageVersion)
|
_ = builder.Entity<PackageDependencyGroup>().HasOne(g=>g.PackageVersion)
|
||||||
.WithMany(v => v.DependencyGroups).HasForeignKey(x => new { x.PackageId, x.PackageVersionFullString } );
|
.WithMany(v => v.DependencyGroups).HasForeignKey(x => new { x.PackageId, x.PackageVersionFullString } );
|
||||||
|
|
||||||
|
_ = builder.Entity<Dependency>().HasOne(d=>d.Group)
|
||||||
|
.WithMany(g=>g.Dependencies);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ namespace isnd.Data.Catalog
|
|||||||
public class CatalogPage : Permalink
|
public class CatalogPage : Permalink
|
||||||
{
|
{
|
||||||
private readonly string pkgid;
|
private readonly string pkgid;
|
||||||
private readonly List<Package> items;
|
private readonly List<RegistrationLeave> items;
|
||||||
|
|
||||||
private readonly string apiBase;
|
private readonly string apiBase;
|
||||||
|
|
||||||
@ -18,12 +18,12 @@ namespace isnd.Data.Catalog
|
|||||||
public CatalogPage (string pkgid, string apiBase) : base(apiBase + $"/registration/{pkgid}/index.json")
|
public CatalogPage (string pkgid, string apiBase) : base(apiBase + $"/registration/{pkgid}/index.json")
|
||||||
{
|
{
|
||||||
Parent = apiBase + $"/registration/{pkgid}/index.json";
|
Parent = apiBase + $"/registration/{pkgid}/index.json";
|
||||||
this.items = new List<Package>();
|
this.items = new List<RegistrationLeave>();
|
||||||
this.pkgid = pkgid;
|
this.pkgid = pkgid;
|
||||||
this.apiBase = apiBase;
|
this.apiBase = apiBase;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CatalogPage(string pkgid, string apiBase, List<PackageVersion> versions) : this(pkgid, apiBase)
|
public CatalogPage(string pkgid, string apiBase, IEnumerable<PackageVersion> versions) : this(pkgid, apiBase)
|
||||||
{
|
{
|
||||||
AddVersionRange(versions);
|
AddVersionRange(versions);
|
||||||
}
|
}
|
||||||
@ -39,7 +39,7 @@ namespace isnd.Data.Catalog
|
|||||||
/// <value></value>
|
/// <value></value>
|
||||||
[JsonProperty("items")]
|
[JsonProperty("items")]
|
||||||
|
|
||||||
public Package[] Items { get => items.ToArray(); }
|
public RegistrationLeave[] Items { get => items.ToArray(); }
|
||||||
|
|
||||||
public void AddVersionRange(IEnumerable<PackageVersion> vitems)
|
public void AddVersionRange(IEnumerable<PackageVersion> vitems)
|
||||||
{
|
{
|
||||||
|
@ -23,7 +23,6 @@ namespace isnd.Data.Catalog
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="pkg">package id</param>
|
/// <param name="pkg">package id</param>
|
||||||
/// <param name="apiBase">api Base</param>
|
/// <param name="apiBase">api Base</param>
|
||||||
/// <param name="uri">package permalink</param>
|
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public PackageDetails(PackageVersion pkg, string apiBase): base( apiBase + ApiConfig.Registration + "/" + pkg.PackageId + "/" + pkg.FullString + ".json")
|
public PackageDetails(PackageVersion pkg, string apiBase): base( apiBase + ApiConfig.Registration + "/" + pkg.PackageId + "/" + pkg.FullString + ".json")
|
||||||
{
|
{
|
||||||
@ -38,7 +37,7 @@ namespace isnd.Data.Catalog
|
|||||||
{
|
{
|
||||||
if (pkg.DependencyGroups.Count>0)
|
if (pkg.DependencyGroups.Count>0)
|
||||||
{
|
{
|
||||||
dependencyGroups = pkg.DependencyGroups.ToArray();
|
DependencySets = pkg.DependencyGroups.ToNugetDepSet();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PackageDetailsUrl = new Uri(this.id);
|
PackageDetailsUrl = new Uri(this.id);
|
||||||
@ -49,6 +48,68 @@ namespace isnd.Data.Catalog
|
|||||||
[JsonProperty("@type")]
|
[JsonProperty("@type")]
|
||||||
public string[] RefType { get; protected set; } = new string[] { "PackageDetails" };
|
public string[] RefType { get; protected set; } = new string[] { "PackageDetails" };
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="apiBase"></param>
|
||||||
|
/// <param name="pkgId"></param>
|
||||||
|
/// <param name="pkgVersionString"></param>
|
||||||
|
/// <param name="commitId"></param>
|
||||||
|
/// <param name="commitTimeStamp"></param>
|
||||||
|
/// <param name="authors"></param>
|
||||||
|
/// <param name="deprecation"></param>
|
||||||
|
/// <param name="description"></param>
|
||||||
|
/// <param name="iconUrl"></param>
|
||||||
|
/// <param name="language"></param>
|
||||||
|
/// <param name="licenseUrl"></param>
|
||||||
|
/// <param name="licenseExpression"></param>
|
||||||
|
/// <param name="minClientVersion"></param>
|
||||||
|
/// <param name="projectUrl"></param>
|
||||||
|
/// <param name="requireLicenseAcceptance"></param>
|
||||||
|
/// <param name="summary"></param>
|
||||||
|
/// <param name="tags"></param>
|
||||||
|
/// <param name="title"></param>
|
||||||
|
/// <param name="packageContent"></param>
|
||||||
|
/// <param name="version"></param>
|
||||||
|
/// <param name="identity"></param>
|
||||||
|
/// <param name="readmeUrl"></param>
|
||||||
|
/// <param name="reportAbuseUrl"></param>
|
||||||
|
/// <param name="packageDetailsUrl"></param>
|
||||||
|
/// <param name="owners"></param>
|
||||||
|
/// <param name="isListed"></param>
|
||||||
|
/// <param name="prefixReserved"></param>
|
||||||
|
/// <param name="licenseMetadata"></param>
|
||||||
|
public PackageDetails(string apiBase, string pkgId, string pkgVersionString, string commitId, DateTimeOffset commitTimeStamp, string authors, Deprecation deprecation, string description, Uri iconUrl, string language, Uri licenseUrl, string licenseExpression, string minClientVersion, Uri projectUrl, bool requireLicenseAcceptance, string summary, string tags, string title, string packageContent, string version, PackageIdentity identity, Uri readmeUrl, Uri reportAbuseUrl, Uri packageDetailsUrl, string owners, bool isListed, bool prefixReserved, LicenseMetadata licenseMetadata)
|
||||||
|
: base( apiBase + ApiConfig.Registration + "/" + pkgId + "/" + pkgVersionString + ".json")
|
||||||
|
{
|
||||||
|
this.CommitId = commitId;
|
||||||
|
this.CommitTimeStamp = commitTimeStamp;
|
||||||
|
this.Authors = authors;
|
||||||
|
this.deprecation = deprecation;
|
||||||
|
this.Description = description;
|
||||||
|
this.IconUrl = iconUrl;
|
||||||
|
this.language = language;
|
||||||
|
this.LicenseUrl = licenseUrl;
|
||||||
|
this.licenseExpression = licenseExpression;
|
||||||
|
this.minClientVersion = minClientVersion;
|
||||||
|
this.ProjectUrl = projectUrl;
|
||||||
|
this.RequireLicenseAcceptance = requireLicenseAcceptance;
|
||||||
|
this.Summary = summary;
|
||||||
|
this.Tags = tags;
|
||||||
|
this.Title = title;
|
||||||
|
this.packageContent = packageContent;
|
||||||
|
this.Version = version;
|
||||||
|
this.Identity = identity;
|
||||||
|
this.ReadmeUrl = readmeUrl;
|
||||||
|
this.ReportAbuseUrl = reportAbuseUrl;
|
||||||
|
this.PackageDetailsUrl = packageDetailsUrl;
|
||||||
|
this.Owners = owners;
|
||||||
|
this.IsListed = isListed;
|
||||||
|
this.PrefixReserved = prefixReserved;
|
||||||
|
this.LicenseMetadata = licenseMetadata;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
[JsonProperty("commitId")]
|
[JsonProperty("commitId")]
|
||||||
public string CommitId { get; set; }
|
public string CommitId { get; set; }
|
||||||
|
|
||||||
@ -62,12 +123,6 @@ namespace isnd.Data.Catalog
|
|||||||
[JsonProperty("authors")]
|
[JsonProperty("authors")]
|
||||||
public string Authors { get; set; }
|
public string Authors { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The dependencies of the package, grouped by target framework
|
|
||||||
/// </summary>
|
|
||||||
/// <value>array of objects</value>
|
|
||||||
public PackageDependencyGroup[] dependencyGroups { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The deprecation associated with the package
|
/// The deprecation associated with the package
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -137,8 +192,6 @@ namespace isnd.Data.Catalog
|
|||||||
[JsonProperty("id")]
|
[JsonProperty("id")]
|
||||||
public string PackageId { get; set; }
|
public string PackageId { get; set; }
|
||||||
|
|
||||||
public IEnumerable<NuGet.Packaging.PackageDependencyGroup> DependencySets { get; set; }
|
|
||||||
= Array.Empty<NuGet.Packaging.PackageDependencyGroup>();
|
|
||||||
|
|
||||||
public long? DownloadCount { get; set; }
|
public long? DownloadCount { get; set; }
|
||||||
|
|
||||||
@ -159,6 +212,8 @@ namespace isnd.Data.Catalog
|
|||||||
|
|
||||||
public LicenseMetadata LicenseMetadata { get; set; }
|
public LicenseMetadata LicenseMetadata { get; set; }
|
||||||
|
|
||||||
|
public IEnumerable<NuGet.Packaging.PackageDependencyGroup> DependencySets {get; set;}
|
||||||
|
|
||||||
public Task<PackageDeprecationMetadata> GetDeprecationMetadataAsync()
|
public Task<PackageDeprecationMetadata> GetDeprecationMetadataAsync()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
|
@ -15,11 +15,11 @@ namespace isnd.Data.Catalog
|
|||||||
Items = new List<CatalogPage>();
|
Items = new List<CatalogPage>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public PackageRegistration(string apiBase, Packages.Package pkg) : base($"{apiBase}{ApiConfig.Registration}/{pkg.Id}/index.json")
|
public PackageRegistration(string apiBase, string pkgId, IEnumerable<PackageVersion> versions) : base($"{apiBase}{ApiConfig.Registration}/{pkgId}/index.json")
|
||||||
{
|
{
|
||||||
Items = new List<CatalogPage>
|
Items = new List<CatalogPage>
|
||||||
{
|
{
|
||||||
new CatalogPage(pkg.Id, apiBase, pkg.Versions)
|
new CatalogPage(pkgId, apiBase, versions)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,9 +9,9 @@ namespace isnd.Data.Catalog
|
|||||||
/// Hosts a catalog entry,
|
/// Hosts a catalog entry,
|
||||||
/// the atomic content reference
|
/// the atomic content reference
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Package
|
public class RegistrationLeave
|
||||||
{
|
{
|
||||||
public Package(string apiBase, string pkgId, string fullVersionString, PackageDetails entry)
|
public RegistrationLeave(string apiBase, string pkgId, string fullVersionString, PackageDetails entry)
|
||||||
{
|
{
|
||||||
|
|
||||||
this.registration = apiBase + ApiConfig.Registration + "/" + pkgId + "/" + fullVersionString + ".json";
|
this.registration = apiBase + ApiConfig.Registration + "/" + pkgId + "/" + fullVersionString + ".json";
|
||||||
|
@ -8,20 +8,23 @@ namespace isnd.Data
|
|||||||
{
|
{
|
||||||
public class Dependency
|
public class Dependency
|
||||||
{
|
{
|
||||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
/// <summary>
|
||||||
|
/// Dependency Package Identifier
|
||||||
|
/// </summary>
|
||||||
|
/// <value></value>
|
||||||
|
[Key]
|
||||||
public string Id { get;set;}
|
public string Id { get;set;}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Package Id
|
/// Dependency Group Id
|
||||||
/// </summary> <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value></value>
|
/// <value></value>
|
||||||
[Required]
|
[Required]
|
||||||
[ForeignKey("Group")]
|
[ForeignKey("Group")]
|
||||||
|
[JsonIgnore]
|
||||||
public string DependencyGroupId { set ; get ; }
|
public string DependencyGroupId { set ; get ; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
public virtual PackageDependencyGroup Group{ get; set; }
|
public virtual PackageDependencyGroup Group{ get; set; }
|
||||||
|
|
||||||
public string Version { get; set; }
|
public string Version { get; set; }
|
||||||
|
@ -1,35 +1,53 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Linq;
|
||||||
using Microsoft.DotNet.Scaffolding.Shared.ProjectModel;
|
using Microsoft.DotNet.Scaffolding.Shared.ProjectModel;
|
||||||
using Microsoft.Identity.Client;
|
using Microsoft.Identity.Client;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using NuGet.Frameworks;
|
using NuGet.Frameworks;
|
||||||
using NuGet.Packaging;
|
using NuGet.Packaging;
|
||||||
using NuGet.Packaging.Core;
|
using NuGet.Packaging.Core;
|
||||||
|
using NuGet.ProjectModel;
|
||||||
using NuGet.Versioning;
|
using NuGet.Versioning;
|
||||||
|
|
||||||
namespace isnd.Data
|
namespace isnd.Data
|
||||||
{
|
{
|
||||||
|
static class Helpers
|
||||||
|
{
|
||||||
|
public static NuGet.Packaging.PackageDependencyGroup[] ToNugetDepSet(this IEnumerable<PackageDependencyGroup> groups)
|
||||||
|
{
|
||||||
|
return groups.Select(group => new NuGet.Packaging.PackageDependencyGroup(
|
||||||
|
new NuGetFramework(group.TargetFramework),
|
||||||
|
group.Dependencies.Select(dep => new PackageDependency(dep.Id))
|
||||||
|
)).ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
public class PackageDependencyGroup
|
public class PackageDependencyGroup
|
||||||
{
|
{
|
||||||
|
[JsonIgnore]
|
||||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
public string Id { get ; set;}
|
public string Id { get ; set;}
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
|
[JsonIgnore]
|
||||||
public string PackageId { get ; set;}
|
public string PackageId { get ; set;}
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
|
[JsonIgnore]
|
||||||
public string PackageVersionFullString { get ; set;}
|
public string PackageVersionFullString { get ; set;}
|
||||||
|
|
||||||
[JsonProperty("targetFramework")]
|
[JsonProperty("targetFramework")]
|
||||||
|
[Required]
|
||||||
public string TargetFramework { get; set; }
|
public string TargetFramework { get; set; }
|
||||||
|
|
||||||
[JsonProperty("dependencies")]
|
[JsonProperty("dependencies")]
|
||||||
[ForeignKey("DependencyGroupId")]
|
[ForeignKey("DependencyGroupId")]
|
||||||
public virtual List<Dependency> Dependencies { get; set; }
|
public virtual List<Dependency> Dependencies { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
public virtual PackageVersion PackageVersion { get; set; }
|
public virtual PackageVersion PackageVersion { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -74,9 +74,9 @@ namespace isnd.Data
|
|||||||
public string SementicVersionString { get => $"{Major}.{Minor}.{Patch}"; }
|
public string SementicVersionString { get => $"{Major}.{Minor}.{Patch}"; }
|
||||||
public NuGetVersion NugetVersion { get => new NuGetVersion(FullString); }
|
public NuGetVersion NugetVersion { get => new NuGetVersion(FullString); }
|
||||||
|
|
||||||
public Catalog.Package ToPackage(string apiBase)
|
public Catalog.RegistrationLeave ToPackage(string apiBase)
|
||||||
{
|
{
|
||||||
return new Catalog.Package(apiBase, this.PackageId , FullString, new Catalog.PackageDetails(this, apiBase));
|
return new Catalog.RegistrationLeave(apiBase, this.PackageId , FullString, new Catalog.PackageDetails(this, apiBase));
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsDeleted => LatestCommit?.Action == PackageAction.DeletePackage;
|
public bool IsDeleted => LatestCommit?.Action == PackageAction.DeletePackage;
|
||||||
|
@ -22,8 +22,8 @@ namespace isnd.Interfaces
|
|||||||
Task<PackageDeletionReport> DeletePackageAsync(string pkgid, string version, string type);
|
Task<PackageDeletionReport> DeletePackageAsync(string pkgid, string version, string type);
|
||||||
Task<PackageDeletionReport> UserAskForPackageDeletionAsync(string userid, string pkgId, string lower, string type);
|
Task<PackageDeletionReport> UserAskForPackageDeletionAsync(string userid, string pkgId, string lower, string type);
|
||||||
Task<PackageVersion> GetPackageAsync(string pkgid, string version, string type);
|
Task<PackageVersion> GetPackageAsync(string pkgid, string version, string type);
|
||||||
Task<Data.Catalog.Package> GetCatalogEntryAsync(string pkgId, string version, string pkgType);
|
Task<Data.Catalog.RegistrationLeave> GetCatalogEntryAsync(string pkgId, string version, string pkgType);
|
||||||
IEnumerable<Data.Catalog.Package> SearchCatalogEntriesById(string pkgId, string semver, string pkgType, bool preRelease);
|
IEnumerable<Data.Catalog.RegistrationLeave> SearchCatalogEntriesById(string pkgId, string semver, string pkgType, bool preRelease);
|
||||||
|
|
||||||
Task<PackageRegistration> GetCatalogIndexAsync();
|
Task<PackageRegistration> GetCatalogIndexAsync();
|
||||||
Task<PackageRegistration> GetPackageRegistrationIndexAsync(PackageRegistrationQuery query);
|
Task<PackageRegistration> GetPackageRegistrationIndexAsync(PackageRegistrationQuery query);
|
||||||
|
531
src/isnd/Migrations/20240331152055_frameworks.Designer.cs
generated
Normal file
531
src/isnd/Migrations/20240331152055_frameworks.Designer.cs
generated
Normal file
@ -0,0 +1,531 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
using isnd.Data;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace isnd.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(ApplicationDbContext))]
|
||||||
|
[Migration("20240331152055_frameworks")]
|
||||||
|
partial class frameworks
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.3")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Id")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ConcurrencyStamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedName")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedName")
|
||||||
|
.IsUnique()
|
||||||
|
.HasDatabaseName("RoleNameIndex");
|
||||||
|
|
||||||
|
b.ToTable("AspNetRoles", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("ClaimType")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ClaimValue")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("RoleId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("RoleId");
|
||||||
|
|
||||||
|
b.ToTable("AspNetRoleClaims", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("ClaimType")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ClaimValue")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUserClaims", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("LoginProvider")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ProviderKey")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ProviderDisplayName")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("LoginProvider", "ProviderKey");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUserLogins", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("RoleId")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "RoleId");
|
||||||
|
|
||||||
|
b.HasIndex("RoleId");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUserRoles", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("LoginProvider")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Value")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "LoginProvider", "Name");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUserTokens", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.ApiKeys.ApiKey", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("CreationDate")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<int>("ValidityPeriodInDays")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("ApiKeys");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.ApplicationUser", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Id")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<int>("AccessFailedCount")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("ConcurrencyStamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<bool>("EmailConfirmed")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("FullName")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("LockoutEnabled")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedEmail")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedUserName")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<string>("PasswordHash")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("PhoneNumber")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("PhoneNumberConfirmed")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("SecurityStamp")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("TwoFactorEnabled")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("UserName")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedEmail")
|
||||||
|
.HasDatabaseName("EmailIndex");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedUserName")
|
||||||
|
.IsUnique()
|
||||||
|
.HasDatabaseName("UserNameIndex");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUsers", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.Dependency", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("DependencyGroupId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Exclude")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Version")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DependencyGroupId");
|
||||||
|
|
||||||
|
b.ToTable("Dependencies");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.PackageDependencyGroup", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("PackageId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("character varying(1024)");
|
||||||
|
|
||||||
|
b.Property<string>("PackageVersionFullString")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<string>("TargetFramework")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("PackageId", "PackageVersionFullString");
|
||||||
|
|
||||||
|
b.ToTable("PackageDependencyGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.PackageVersion", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("PackageId")
|
||||||
|
.HasMaxLength(1024)
|
||||||
|
.HasColumnType("character varying(1024)");
|
||||||
|
|
||||||
|
b.Property<string>("FullString")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<long>("CommitNId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<bool>("IsPrerelease")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<int>("Major")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<int>("Minor")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<int>("Patch")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<int>("Revision")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("Type")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.HasKey("PackageId", "FullString");
|
||||||
|
|
||||||
|
b.HasIndex("CommitNId");
|
||||||
|
|
||||||
|
b.ToTable("PackageVersions");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.Packages.Commit", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Action")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("TimeStamp")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Commits");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.Packages.Package", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Id")
|
||||||
|
.HasMaxLength(1024)
|
||||||
|
.HasColumnType("character varying(1024)");
|
||||||
|
|
||||||
|
b.Property<long>("CommitNId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.HasMaxLength(1024)
|
||||||
|
.HasColumnType("character varying(1024)");
|
||||||
|
|
||||||
|
b.Property<string>("OwnerId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("Public")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("CommitNId");
|
||||||
|
|
||||||
|
b.HasIndex("OwnerId");
|
||||||
|
|
||||||
|
b.ToTable("Packages");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RoleId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("isnd.Data.ApplicationUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("isnd.Data.ApplicationUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RoleId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("isnd.Data.ApplicationUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("isnd.Data.ApplicationUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.ApiKeys.ApiKey", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("isnd.Data.ApplicationUser", "User")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.Dependency", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("isnd.Data.PackageDependencyGroup", "Group")
|
||||||
|
.WithMany("Dependencies")
|
||||||
|
.HasForeignKey("DependencyGroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.PackageDependencyGroup", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("isnd.Data.PackageVersion", "PackageVersion")
|
||||||
|
.WithMany("DependencyGroups")
|
||||||
|
.HasForeignKey("PackageId", "PackageVersionFullString")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("PackageVersion");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.PackageVersion", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("isnd.Data.Packages.Commit", "LatestCommit")
|
||||||
|
.WithMany("Versions")
|
||||||
|
.HasForeignKey("CommitNId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("isnd.Data.Packages.Package", "Package")
|
||||||
|
.WithMany("Versions")
|
||||||
|
.HasForeignKey("PackageId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("LatestCommit");
|
||||||
|
|
||||||
|
b.Navigation("Package");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.Packages.Package", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("isnd.Data.Packages.Commit", "LatestCommit")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("CommitNId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("isnd.Data.ApplicationUser", "Owner")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("OwnerId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("LatestCommit");
|
||||||
|
|
||||||
|
b.Navigation("Owner");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.PackageDependencyGroup", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Dependencies");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.PackageVersion", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("DependencyGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.Packages.Commit", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Versions");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.Packages.Package", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Versions");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
169
src/isnd/Migrations/20240331152055_frameworks.cs
Normal file
169
src/isnd/Migrations/20240331152055_frameworks.cs
Normal file
@ -0,0 +1,169 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace isnd.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class frameworks : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_Depedencies_PackageDependencyGroups_DependencyGroupId",
|
||||||
|
table: "Depedencies");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_PackageDependencyGroups_PackageVersions_PackageVersionPacka~",
|
||||||
|
table: "PackageDependencyGroups");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_PackageDependencyGroups_PackageVersionPackageId_PackageVers~",
|
||||||
|
table: "PackageDependencyGroups");
|
||||||
|
|
||||||
|
migrationBuilder.DropPrimaryKey(
|
||||||
|
name: "PK_Depedencies",
|
||||||
|
table: "Depedencies");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "PackageVersionId",
|
||||||
|
table: "PackageDependencyGroups");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "PackageVersionPackageId",
|
||||||
|
table: "PackageDependencyGroups");
|
||||||
|
|
||||||
|
migrationBuilder.RenameTable(
|
||||||
|
name: "Depedencies",
|
||||||
|
newName: "Dependencies");
|
||||||
|
|
||||||
|
migrationBuilder.RenameIndex(
|
||||||
|
name: "IX_Depedencies_DependencyGroupId",
|
||||||
|
table: "Dependencies",
|
||||||
|
newName: "IX_Dependencies_DependencyGroupId");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "PackageVersionFullString",
|
||||||
|
table: "PackageDependencyGroups",
|
||||||
|
type: "character varying(256)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: "",
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "character varying(256)",
|
||||||
|
oldNullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "PackageId",
|
||||||
|
table: "PackageDependencyGroups",
|
||||||
|
type: "character varying(1024)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: "");
|
||||||
|
|
||||||
|
migrationBuilder.AddPrimaryKey(
|
||||||
|
name: "PK_Dependencies",
|
||||||
|
table: "Dependencies",
|
||||||
|
column: "Id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_PackageDependencyGroups_PackageId_PackageVersionFullString",
|
||||||
|
table: "PackageDependencyGroups",
|
||||||
|
columns: new[] { "PackageId", "PackageVersionFullString" });
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Dependencies_PackageDependencyGroups_DependencyGroupId",
|
||||||
|
table: "Dependencies",
|
||||||
|
column: "DependencyGroupId",
|
||||||
|
principalTable: "PackageDependencyGroups",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_PackageDependencyGroups_PackageVersions_PackageId_PackageVe~",
|
||||||
|
table: "PackageDependencyGroups",
|
||||||
|
columns: new[] { "PackageId", "PackageVersionFullString" },
|
||||||
|
principalTable: "PackageVersions",
|
||||||
|
principalColumns: new[] { "PackageId", "FullString" },
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_Dependencies_PackageDependencyGroups_DependencyGroupId",
|
||||||
|
table: "Dependencies");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_PackageDependencyGroups_PackageVersions_PackageId_PackageVe~",
|
||||||
|
table: "PackageDependencyGroups");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_PackageDependencyGroups_PackageId_PackageVersionFullString",
|
||||||
|
table: "PackageDependencyGroups");
|
||||||
|
|
||||||
|
migrationBuilder.DropPrimaryKey(
|
||||||
|
name: "PK_Dependencies",
|
||||||
|
table: "Dependencies");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "PackageId",
|
||||||
|
table: "PackageDependencyGroups");
|
||||||
|
|
||||||
|
migrationBuilder.RenameTable(
|
||||||
|
name: "Dependencies",
|
||||||
|
newName: "Depedencies");
|
||||||
|
|
||||||
|
migrationBuilder.RenameIndex(
|
||||||
|
name: "IX_Dependencies_DependencyGroupId",
|
||||||
|
table: "Depedencies",
|
||||||
|
newName: "IX_Depedencies_DependencyGroupId");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "PackageVersionFullString",
|
||||||
|
table: "PackageDependencyGroups",
|
||||||
|
type: "character varying(256)",
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "character varying(256)");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "PackageVersionId",
|
||||||
|
table: "PackageDependencyGroups",
|
||||||
|
type: "text",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: "");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "PackageVersionPackageId",
|
||||||
|
table: "PackageDependencyGroups",
|
||||||
|
type: "character varying(1024)",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddPrimaryKey(
|
||||||
|
name: "PK_Depedencies",
|
||||||
|
table: "Depedencies",
|
||||||
|
column: "Id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_PackageDependencyGroups_PackageVersionPackageId_PackageVers~",
|
||||||
|
table: "PackageDependencyGroups",
|
||||||
|
columns: new[] { "PackageVersionPackageId", "PackageVersionFullString" });
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Depedencies_PackageDependencyGroups_DependencyGroupId",
|
||||||
|
table: "Depedencies",
|
||||||
|
column: "DependencyGroupId",
|
||||||
|
principalTable: "PackageDependencyGroups",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_PackageDependencyGroups_PackageVersions_PackageVersionPacka~",
|
||||||
|
table: "PackageDependencyGroups",
|
||||||
|
columns: new[] { "PackageVersionPackageId", "PackageVersionFullString" },
|
||||||
|
principalTable: "PackageVersions",
|
||||||
|
principalColumns: new[] { "PackageId", "FullString" });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
532
src/isnd/Migrations/20240406181803_frameworkRefRequired.Designer.cs
generated
Normal file
532
src/isnd/Migrations/20240406181803_frameworkRefRequired.Designer.cs
generated
Normal file
@ -0,0 +1,532 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
using isnd.Data;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace isnd.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(ApplicationDbContext))]
|
||||||
|
[Migration("20240406181803_frameworkRefRequired")]
|
||||||
|
partial class frameworkRefRequired
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.3")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Id")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ConcurrencyStamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedName")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedName")
|
||||||
|
.IsUnique()
|
||||||
|
.HasDatabaseName("RoleNameIndex");
|
||||||
|
|
||||||
|
b.ToTable("AspNetRoles", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("ClaimType")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ClaimValue")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("RoleId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("RoleId");
|
||||||
|
|
||||||
|
b.ToTable("AspNetRoleClaims", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("ClaimType")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ClaimValue")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUserClaims", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("LoginProvider")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ProviderKey")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ProviderDisplayName")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("LoginProvider", "ProviderKey");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUserLogins", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("RoleId")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "RoleId");
|
||||||
|
|
||||||
|
b.HasIndex("RoleId");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUserRoles", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("LoginProvider")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Value")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "LoginProvider", "Name");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUserTokens", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.ApiKeys.ApiKey", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("CreationDate")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<int>("ValidityPeriodInDays")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("ApiKeys");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.ApplicationUser", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Id")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<int>("AccessFailedCount")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("ConcurrencyStamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<bool>("EmailConfirmed")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("FullName")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("LockoutEnabled")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedEmail")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedUserName")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<string>("PasswordHash")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("PhoneNumber")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("PhoneNumberConfirmed")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("SecurityStamp")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("TwoFactorEnabled")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("UserName")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedEmail")
|
||||||
|
.HasDatabaseName("EmailIndex");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedUserName")
|
||||||
|
.IsUnique()
|
||||||
|
.HasDatabaseName("UserNameIndex");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUsers", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.Dependency", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("DependencyGroupId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Exclude")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Version")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DependencyGroupId");
|
||||||
|
|
||||||
|
b.ToTable("Dependencies");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.PackageDependencyGroup", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("PackageId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("character varying(1024)");
|
||||||
|
|
||||||
|
b.Property<string>("PackageVersionFullString")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<string>("TargetFramework")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("PackageId", "PackageVersionFullString");
|
||||||
|
|
||||||
|
b.ToTable("PackageDependencyGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.PackageVersion", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("PackageId")
|
||||||
|
.HasMaxLength(1024)
|
||||||
|
.HasColumnType("character varying(1024)");
|
||||||
|
|
||||||
|
b.Property<string>("FullString")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<long>("CommitNId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<bool>("IsPrerelease")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<int>("Major")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<int>("Minor")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<int>("Patch")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<int>("Revision")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("Type")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.HasKey("PackageId", "FullString");
|
||||||
|
|
||||||
|
b.HasIndex("CommitNId");
|
||||||
|
|
||||||
|
b.ToTable("PackageVersions");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.Packages.Commit", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Action")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("TimeStamp")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Commits");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.Packages.Package", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Id")
|
||||||
|
.HasMaxLength(1024)
|
||||||
|
.HasColumnType("character varying(1024)");
|
||||||
|
|
||||||
|
b.Property<long>("CommitNId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.HasMaxLength(1024)
|
||||||
|
.HasColumnType("character varying(1024)");
|
||||||
|
|
||||||
|
b.Property<string>("OwnerId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("Public")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("CommitNId");
|
||||||
|
|
||||||
|
b.HasIndex("OwnerId");
|
||||||
|
|
||||||
|
b.ToTable("Packages");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RoleId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("isnd.Data.ApplicationUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("isnd.Data.ApplicationUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RoleId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("isnd.Data.ApplicationUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("isnd.Data.ApplicationUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.ApiKeys.ApiKey", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("isnd.Data.ApplicationUser", "User")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.Dependency", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("isnd.Data.PackageDependencyGroup", "Group")
|
||||||
|
.WithMany("Dependencies")
|
||||||
|
.HasForeignKey("DependencyGroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.PackageDependencyGroup", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("isnd.Data.PackageVersion", "PackageVersion")
|
||||||
|
.WithMany("DependencyGroups")
|
||||||
|
.HasForeignKey("PackageId", "PackageVersionFullString")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("PackageVersion");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.PackageVersion", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("isnd.Data.Packages.Commit", "LatestCommit")
|
||||||
|
.WithMany("Versions")
|
||||||
|
.HasForeignKey("CommitNId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("isnd.Data.Packages.Package", "Package")
|
||||||
|
.WithMany("Versions")
|
||||||
|
.HasForeignKey("PackageId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("LatestCommit");
|
||||||
|
|
||||||
|
b.Navigation("Package");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.Packages.Package", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("isnd.Data.Packages.Commit", "LatestCommit")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("CommitNId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("isnd.Data.ApplicationUser", "Owner")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("OwnerId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("LatestCommit");
|
||||||
|
|
||||||
|
b.Navigation("Owner");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.PackageDependencyGroup", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Dependencies");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.PackageVersion", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("DependencyGroups");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.Packages.Commit", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Versions");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("isnd.Data.Packages.Package", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Versions");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
36
src/isnd/Migrations/20240406181803_frameworkRefRequired.cs
Normal file
36
src/isnd/Migrations/20240406181803_frameworkRefRequired.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace isnd.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class frameworkRefRequired : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "TargetFramework",
|
||||||
|
table: "PackageDependencyGroups",
|
||||||
|
type: "text",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: "",
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "text",
|
||||||
|
oldNullable: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "TargetFramework",
|
||||||
|
table: "PackageDependencyGroups",
|
||||||
|
type: "text",
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "text");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -177,7 +177,7 @@ namespace isnd.Migrations
|
|||||||
|
|
||||||
b.HasIndex("UserId");
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
b.ToTable("ApiKeys");
|
b.ToTable("ApiKeys", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("isnd.Data.ApplicationUser", b =>
|
modelBuilder.Entity("isnd.Data.ApplicationUser", b =>
|
||||||
@ -267,7 +267,7 @@ namespace isnd.Migrations
|
|||||||
|
|
||||||
b.HasIndex("DependencyGroupId");
|
b.HasIndex("DependencyGroupId");
|
||||||
|
|
||||||
b.ToTable("Depedencies");
|
b.ToTable("Dependencies", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("isnd.Data.PackageDependencyGroup", b =>
|
modelBuilder.Entity("isnd.Data.PackageDependencyGroup", b =>
|
||||||
@ -276,24 +276,23 @@ namespace isnd.Migrations
|
|||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("PackageVersionFullString")
|
b.Property<string>("PackageId")
|
||||||
.HasColumnType("character varying(256)");
|
|
||||||
|
|
||||||
b.Property<string>("PackageVersionId")
|
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("PackageVersionPackageId")
|
|
||||||
.HasColumnType("character varying(1024)");
|
.HasColumnType("character varying(1024)");
|
||||||
|
|
||||||
|
b.Property<string>("PackageVersionFullString")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
b.Property<string>("TargetFramework")
|
b.Property<string>("TargetFramework")
|
||||||
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("PackageVersionPackageId", "PackageVersionFullString");
|
b.HasIndex("PackageId", "PackageVersionFullString");
|
||||||
|
|
||||||
b.ToTable("PackageDependencyGroups");
|
b.ToTable("PackageDependencyGroups", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("isnd.Data.PackageVersion", b =>
|
modelBuilder.Entity("isnd.Data.PackageVersion", b =>
|
||||||
@ -332,7 +331,7 @@ namespace isnd.Migrations
|
|||||||
|
|
||||||
b.HasIndex("CommitNId");
|
b.HasIndex("CommitNId");
|
||||||
|
|
||||||
b.ToTable("PackageVersions");
|
b.ToTable("PackageVersions", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("isnd.Data.Packages.Commit", b =>
|
modelBuilder.Entity("isnd.Data.Packages.Commit", b =>
|
||||||
@ -351,7 +350,7 @@ namespace isnd.Migrations
|
|||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.ToTable("Commits");
|
b.ToTable("Commits", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("isnd.Data.Packages.Package", b =>
|
modelBuilder.Entity("isnd.Data.Packages.Package", b =>
|
||||||
@ -380,7 +379,7 @@ namespace isnd.Migrations
|
|||||||
|
|
||||||
b.HasIndex("OwnerId");
|
b.HasIndex("OwnerId");
|
||||||
|
|
||||||
b.ToTable("Packages");
|
b.ToTable("Packages", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||||
@ -458,9 +457,13 @@ namespace isnd.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("isnd.Data.PackageDependencyGroup", b =>
|
modelBuilder.Entity("isnd.Data.PackageDependencyGroup", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("isnd.Data.PackageVersion", null)
|
b.HasOne("isnd.Data.PackageVersion", "PackageVersion")
|
||||||
.WithMany("DependencyGroups")
|
.WithMany("DependencyGroups")
|
||||||
.HasForeignKey("PackageVersionPackageId", "PackageVersionFullString");
|
.HasForeignKey("PackageId", "PackageVersionFullString")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("PackageVersion");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("isnd.Data.PackageVersion", b =>
|
modelBuilder.Entity("isnd.Data.PackageVersion", b =>
|
||||||
|
11
src/isnd/Services/FrameworkDependencyGroup.cs
Normal file
11
src/isnd/Services/FrameworkDependencyGroup.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace isnd.Services
|
||||||
|
{
|
||||||
|
public class FrameworkDependencyGroup
|
||||||
|
{
|
||||||
|
internal string FrameworkName { get; set; }
|
||||||
|
|
||||||
|
internal List<ShortDependencyInfo> Dependencies { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -21,6 +21,7 @@ using NuGet.Versioning;
|
|||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using NuGet.Protocol;
|
||||||
|
|
||||||
namespace isnd.Services
|
namespace isnd.Services
|
||||||
{
|
{
|
||||||
@ -228,19 +229,26 @@ namespace isnd.Services
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<Data.Catalog.Package> GetCatalogEntryAsync
|
public async Task<Data.Catalog.RegistrationLeave> GetCatalogEntryAsync
|
||||||
(string pkgId, string semver = null, string pkgType = null)
|
(string pkgId, string semver, string pkgType = null)
|
||||||
{
|
{
|
||||||
return (await dbContext.PackageVersions
|
var version = await dbContext.PackageVersions
|
||||||
.Include(v => v.Package)
|
.Include(v => v.Package)
|
||||||
.Include(v => v.Package.LatestCommit)
|
.Include(v => v.Package.LatestCommit)
|
||||||
.Include(v => v.Package.Owner)
|
.Include(v => v.Package.Owner)
|
||||||
|
.Include(v => v.DependencyGroups)
|
||||||
.Include(v => v.LatestCommit)
|
.Include(v => v.LatestCommit)
|
||||||
.Where(v => v.PackageId == pkgId
|
.Where(v => v.PackageId == pkgId
|
||||||
&& v.FullString == semver
|
&& v.FullString == semver
|
||||||
&& v.LatestCommit != null
|
&& v.LatestCommit != null
|
||||||
).SingleOrDefaultAsync()).ToPackage(
|
).SingleOrDefaultAsync();
|
||||||
apiBase);
|
|
||||||
|
foreach (var g in version.DependencyGroups)
|
||||||
|
{
|
||||||
|
g.Dependencies = dbContext.Dependencies.Where(d => d.DependencyGroupId == g.Id).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
return version.ToPackage(apiBase);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<PackageDeletionReport> UserAskForPackageDeletionAsync
|
public async Task<PackageDeletionReport> UserAskForPackageDeletionAsync
|
||||||
@ -256,7 +264,7 @@ namespace isnd.Services
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public IEnumerable<Data.Catalog.Package> SearchCatalogEntriesById
|
public IEnumerable<Data.Catalog.RegistrationLeave> SearchCatalogEntriesById
|
||||||
(string pkgId, string semver, string pkgType, bool preRelease)
|
(string pkgId, string semver, string pkgType, bool preRelease)
|
||||||
{
|
{
|
||||||
// PackageDependency
|
// PackageDependency
|
||||||
@ -278,6 +286,7 @@ namespace isnd.Services
|
|||||||
return dbContext.PackageVersions
|
return dbContext.PackageVersions
|
||||||
.Include(v => v.Package)
|
.Include(v => v.Package)
|
||||||
.Include(v => v.LatestCommit)
|
.Include(v => v.LatestCommit)
|
||||||
|
.Include(v => v.DependencyGroups.Last().Dependencies)
|
||||||
.Single(v => v.PackageId == pkgId && semver == v.FullString
|
.Single(v => v.PackageId == pkgId && semver == v.FullString
|
||||||
&& (pkgType == null || pkgType == v.Type));
|
&& (pkgType == null || pkgType == v.Type));
|
||||||
}
|
}
|
||||||
@ -288,18 +297,25 @@ namespace isnd.Services
|
|||||||
// RegistrationPageIndexAndQuery
|
// RegistrationPageIndexAndQuery
|
||||||
if (string.IsNullOrWhiteSpace(query.Query)) return null;
|
if (string.IsNullOrWhiteSpace(query.Query)) return null;
|
||||||
query.Query = query.Query.ToLower();
|
query.Query = query.Query.ToLower();
|
||||||
var scope = await dbContext.Packages
|
var scope = await dbContext.PackageVersions
|
||||||
.Include(p => p.Versions)
|
.Include(p => p.Package)
|
||||||
.Include(p => p.Owner)
|
.Include(p => p.Package.Owner)
|
||||||
.Include(p => p.LatestCommit)
|
.Include(p => p.LatestCommit)
|
||||||
.SingleOrDefaultAsync(p => p.Id.ToLower() == query.Query);
|
.Where(p => p.PackageId.ToLower() == query.Query).ToArrayAsync();
|
||||||
if (scope == null) return null;
|
if (scope == null) return null;
|
||||||
if (scope.Versions.Count == 0) return null;
|
if (scope.Length == 0) return null;
|
||||||
string bid = $"{apiBase}{ApiConfig.Registration}";
|
string bid = $"{apiBase}{ApiConfig.Registration}";
|
||||||
foreach (var version in scope.Versions)
|
|
||||||
|
foreach (var version in scope)
|
||||||
|
{
|
||||||
|
version.DependencyGroups = dbContext.PackageDependencyGroups.Include(d => d.Dependencies)
|
||||||
|
.Where(d => d.PackageId == version.PackageId && d.PackageVersionFullString == version.FullString)
|
||||||
|
.ToList();
|
||||||
version.LatestCommit = dbContext.Commits.Single(c => c.Id == version.CommitNId);
|
version.LatestCommit = dbContext.Commits.Single(c => c.Id == version.CommitNId);
|
||||||
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
new PackageRegistration(apiBase, scope);
|
new PackageRegistration(apiBase, query.Query, scope);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<PackageSearchResult> SearchPackageAsync(PackageRegistrationQuery query)
|
public async Task<PackageSearchResult> SearchPackageAsync(PackageRegistrationQuery query)
|
||||||
@ -307,19 +323,21 @@ namespace isnd.Services
|
|||||||
string bid = $"{apiBase}{ApiConfig.Registration}";
|
string bid = $"{apiBase}{ApiConfig.Registration}";
|
||||||
if (string.IsNullOrWhiteSpace(query.Query))
|
if (string.IsNullOrWhiteSpace(query.Query))
|
||||||
query.Query = "";
|
query.Query = "";
|
||||||
var scope = dbContext.Packages
|
|
||||||
.Include(p => p.Owner)
|
|
||||||
.Include(p => p.Versions)
|
|
||||||
.Include(p => p.LatestCommit)
|
|
||||||
.Include(p => p.LatestCommit.Versions)
|
|
||||||
.Where(p => p.Id.StartsWith(query.Query)
|
|
||||||
&& p.LatestCommit != null
|
|
||||||
&& (query.Prerelease || p.Versions.Any(p => !p.IsPrerelease))
|
|
||||||
&& p.Versions.Count() > 0)
|
|
||||||
.OrderBy(p => p.CommitNId);
|
|
||||||
|
|
||||||
return new PackageSearchResult(await scope.Skip(query.Skip).Take(query.Take)
|
var packages = await dbContext.Packages
|
||||||
.ToListAsync(), apiBase, scope.Count());
|
.Include(g => g.Versions)
|
||||||
|
.Where(d => d.Id.StartsWith(query.Query)
|
||||||
|
&& (query.Prerelease || d.Versions.Any(v => !v.IsPrerelease)))
|
||||||
|
.Skip(query.Skip).Take(query.Take).ToArrayAsync();
|
||||||
|
foreach (var package in packages)
|
||||||
|
foreach (var version in package.Versions)
|
||||||
|
{
|
||||||
|
version.DependencyGroups = dbContext.PackageDependencyGroups.Include(d => d.Dependencies)
|
||||||
|
.Where(d => d.PackageVersionFullString == version.FullString && d.PackageId == version.PackageId)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return new PackageSearchResult(packages, apiBase, packages.Count());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<PackageVersion> PutPackageAsync(Stream packageStream, string ownerId)
|
public async Task<PackageVersion> PutPackageAsync(Stream packageStream, string ownerId)
|
||||||
@ -345,22 +363,19 @@ namespace isnd.Services
|
|||||||
string packageDescription = xMeta.Descendants().FirstOrDefault(x => x.Name.LocalName == "description")?.Value;
|
string packageDescription = xMeta.Descendants().FirstOrDefault(x => x.Name.LocalName == "description")?.Value;
|
||||||
|
|
||||||
var frameWorks = xMeta
|
var frameWorks = xMeta
|
||||||
.Descendants().FirstOrDefault(x => x.Name.LocalName =="frameworkReferences")
|
.Descendants().FirstOrDefault(x => x.Name.LocalName == "frameworkReferences")
|
||||||
.Descendants().Where(x => x.Name.LocalName =="group")
|
.Descendants().Where(x => x.Name.LocalName == "group")
|
||||||
.Select(x=> x.Attribute("targetFramework").Value).ToArray();
|
.Select(x => NewFrameworkDependencyGroup(x)).ToArray();
|
||||||
var types = "Package";
|
var types = "Package";
|
||||||
|
|
||||||
pkgId = xMeta.Descendants().FirstOrDefault(x => x.Name.LocalName =="id")?.Value;
|
pkgId = xMeta.Descendants().FirstOrDefault(x => x.Name.LocalName == "id")?.Value;
|
||||||
string pkgVersion = xMeta.Descendants().FirstOrDefault(x => x.Name.LocalName =="version")?.Value;
|
string pkgVersion = xMeta.Descendants().FirstOrDefault(x => x.Name.LocalName == "version")?.Value;
|
||||||
|
|
||||||
if (!NuGetVersion.TryParse(pkgVersion, out nugetVersion))
|
if (!NuGetVersion.TryParse(pkgVersion, out nugetVersion))
|
||||||
throw new InvalidPackageException("metadata/version");
|
throw new InvalidPackageException("metadata/version");
|
||||||
|
|
||||||
var frameworkReferences = frameWorks.Select(g => new PackageDependencyGroup
|
|
||||||
{
|
|
||||||
TargetFramework = g
|
|
||||||
}
|
|
||||||
).ToList();
|
|
||||||
|
|
||||||
string packageIdPath = Path.Combine(isndSettings.PackagesRootDir,
|
string packageIdPath = Path.Combine(isndSettings.PackagesRootDir,
|
||||||
pkgId);
|
pkgId);
|
||||||
@ -416,27 +431,51 @@ namespace isnd.Services
|
|||||||
foreach (var v in pkgVersions.ToArray())
|
foreach (var v in pkgVersions.ToArray())
|
||||||
dbContext.PackageVersions.Remove(v);
|
dbContext.PackageVersions.Remove(v);
|
||||||
}
|
}
|
||||||
|
string versionFullString = nugetVersion.ToFullString();
|
||||||
|
|
||||||
// FIXME default type or null
|
// FIXME default package type or null
|
||||||
dbContext.PackageVersions.Add
|
dbContext.PackageVersions.Add
|
||||||
(version = new PackageVersion
|
(version = new PackageVersion
|
||||||
{
|
{
|
||||||
|
|
||||||
Package = pkg,
|
Package = pkg,
|
||||||
Major = nugetVersion.Major,
|
Major = nugetVersion.Major,
|
||||||
Minor = nugetVersion.Minor,
|
Minor = nugetVersion.Minor,
|
||||||
Patch = nugetVersion.Patch,
|
Patch = nugetVersion.Patch,
|
||||||
Revision = nugetVersion.Revision,
|
Revision = nugetVersion.Revision,
|
||||||
IsPrerelease = nugetVersion.IsPrerelease,
|
IsPrerelease = nugetVersion.IsPrerelease,
|
||||||
FullString = nugetVersion.ToFullString(),
|
FullString = versionFullString,
|
||||||
Type =types,
|
Type = types,
|
||||||
LatestCommit = commit
|
LatestCommit = commit
|
||||||
});
|
});
|
||||||
|
|
||||||
dbContext.Commits.Add(commit);
|
dbContext.Commits.Add(commit);
|
||||||
|
|
||||||
|
foreach (var group in dbContext.PackageDependencyGroups.Include(g => g.PackageVersion)
|
||||||
|
.Where(x => x.PackageId == pkgId && x.PackageVersionFullString == versionFullString)
|
||||||
|
.ToList())
|
||||||
|
{
|
||||||
|
dbContext.PackageDependencyGroups.Remove(group);
|
||||||
|
}
|
||||||
|
version.DependencyGroups = new List<PackageDependencyGroup>();
|
||||||
|
foreach (var framework in frameWorks)
|
||||||
|
{
|
||||||
|
var group = new PackageDependencyGroup
|
||||||
|
{
|
||||||
|
TargetFramework = framework.FrameworkName,
|
||||||
|
PackageId = pkgId,
|
||||||
|
PackageVersionFullString = versionFullString,
|
||||||
|
Dependencies = framework.Dependencies.Select(
|
||||||
|
d => new Dependency
|
||||||
|
{
|
||||||
|
Id = d.PackageId,
|
||||||
|
Version = d.PackageVersion,
|
||||||
|
}).ToList()
|
||||||
|
};
|
||||||
|
version.DependencyGroups.Add(group);
|
||||||
|
dbContext.PackageDependencyGroups.Add(group);
|
||||||
|
|
||||||
|
}
|
||||||
await dbContext.SaveChangesAsync();
|
await dbContext.SaveChangesAsync();
|
||||||
version.DependencyGroups = frameworkReferences;
|
|
||||||
await UpdateCatalogForAsync(commit);
|
await UpdateCatalogForAsync(commit);
|
||||||
|
|
||||||
|
|
||||||
@ -465,5 +504,22 @@ namespace isnd.Services
|
|||||||
}
|
}
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private FrameworkDependencyGroup NewFrameworkDependencyGroup(XElement x)
|
||||||
|
{
|
||||||
|
var view = x.ToJson();
|
||||||
|
var frameworkReferences = x.Descendants();
|
||||||
|
var framework = x.Attribute("targetFramework").Value;
|
||||||
|
return new FrameworkDependencyGroup
|
||||||
|
{
|
||||||
|
FrameworkName = framework,
|
||||||
|
Dependencies = frameworkReferences.Select(r => new ShortDependencyInfo
|
||||||
|
{
|
||||||
|
PackageId = r.Attribute("name").Value,
|
||||||
|
PackageVersion = r.Attribute("version")?.Value
|
||||||
|
}).ToList()
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
8
src/isnd/Services/ShortDependencyInfo.cs
Normal file
8
src/isnd/Services/ShortDependencyInfo.cs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
namespace isnd.Services
|
||||||
|
{
|
||||||
|
public class ShortDependencyInfo
|
||||||
|
{
|
||||||
|
internal string PackageId { get; set;}
|
||||||
|
internal string PackageVersion { get; set;}
|
||||||
|
}
|
||||||
|
}
|
@ -8,9 +8,10 @@ namespace isnd.ViewModels
|
|||||||
{
|
{
|
||||||
public class PackageHit : Permalink
|
public class PackageHit : Permalink
|
||||||
{
|
{
|
||||||
public PackageHit(string id, string packageId) : base(id, "Package")
|
public PackageHit(string registrationId, string packageId) : base(registrationId, "Package")
|
||||||
{
|
{
|
||||||
PackageId = packageId;
|
PackageId = packageId;
|
||||||
|
registration = registrationId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -36,7 +37,7 @@ namespace isnd.ViewModels
|
|||||||
/// The absolute URL to the associated registration index
|
/// The absolute URL to the associated registration index
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value></value>
|
/// <value></value>
|
||||||
public string registration { get; set; }
|
public string registration { get; }
|
||||||
public string summary { get; set; }
|
public string summary { get; set; }
|
||||||
public string[] tags { get; set; }
|
public string[] tags { get; set; }
|
||||||
public string title { get; set; }
|
public string title { get; set; }
|
||||||
|
@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection.Metadata.Ecma335;
|
using System.Reflection.Metadata.Ecma335;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
using isnd.Data;
|
||||||
using isnd.Data.Packages;
|
using isnd.Data.Packages;
|
||||||
using isnd.Entities;
|
using isnd.Entities;
|
||||||
|
|
||||||
@ -25,7 +26,7 @@ namespace isnd.ViewModels
|
|||||||
{
|
{
|
||||||
this.result = result;
|
this.result = result;
|
||||||
this.ApiBase = apiBase;
|
this.ApiBase = apiBase;
|
||||||
data=result.Select(r => NewPackageHit(apiBase, r)).ToArray();
|
data=result.Select(p=> NewPackageHit(apiBase, p)).ToArray();
|
||||||
this.totalHits = totalHit;
|
this.totalHits = totalHit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,10 +37,7 @@ namespace isnd.ViewModels
|
|||||||
{
|
{
|
||||||
version = package.GetLatestVersion(),
|
version = package.GetLatestVersion(),
|
||||||
description = package.Description,
|
description = package.Description,
|
||||||
title = package.Id,
|
versions = package.Versions.Select(v => new SearchVersionInfo(regId, v)).ToArray()
|
||||||
versions = package.Versions.Select(v => new SearchVersionInfo(regId, v)).ToArray(),
|
|
||||||
registration = regId,
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<configuration>
|
|
||||||
<apikeys>
|
|
||||||
</apikeys>
|
|
||||||
<packageSources>
|
|
||||||
<add key="dev" value="http://localhost:5000/v3/index.json" protocolVersion="3" />
|
|
||||||
</packageSources>
|
|
||||||
</configuration>
|
|
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<RootNamespace>test_isn</RootNamespace>
|
<RootNamespace>test_isn</RootNamespace>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
|
@ -155,10 +155,11 @@ namespace isnd.host.tests
|
|||||||
repository.PackageSource.AllowInsecureConnections=true;
|
repository.PackageSource.AllowInsecureConnections=true;
|
||||||
|
|
||||||
PackageSearchResource resource = await repository.GetResourceAsync<PackageSearchResource>();
|
PackageSearchResource resource = await repository.GetResourceAsync<PackageSearchResource>();
|
||||||
|
|
||||||
SearchFilter searchFilter = new SearchFilter(includePrerelease: true);
|
SearchFilter searchFilter = new SearchFilter(includePrerelease: true);
|
||||||
|
|
||||||
IEnumerable<IPackageSearchMetadata> results = await resource.SearchAsync(
|
IEnumerable<IPackageSearchMetadata> results = await resource.SearchAsync(
|
||||||
"isn",
|
"isnd",
|
||||||
searchFilter,
|
searchFilter,
|
||||||
skip: 0,
|
skip: 0,
|
||||||
take: 20,
|
take: 20,
|
||||||
@ -169,7 +170,7 @@ namespace isnd.host.tests
|
|||||||
{
|
{
|
||||||
Console.WriteLine($"Found package {result.Identity.Id} {result.Identity.Version}");
|
Console.WriteLine($"Found package {result.Identity.Id} {result.Identity.Version}");
|
||||||
}
|
}
|
||||||
|
Assert.True( results.Any(result => result.DependencySets.Any()));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
@ -182,6 +183,7 @@ namespace isnd.host.tests
|
|||||||
|
|
||||||
await pushRes.Push(new List<string>{ "../../../../../src/isnd/bin/Release/isnd.1.1.4.nupkg" }, null,
|
await pushRes.Push(new List<string>{ "../../../../../src/isnd/bin/Release/isnd.1.1.4.nupkg" }, null,
|
||||||
5000, false, GetApiKey, GetSymbolsApiKey, false, false, symbolPackageResource, logger);
|
5000, false, GetApiKey, GetSymbolsApiKey, false, false, symbolPackageResource, logger);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
Reference in New Issue
Block a user