//
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using OpenArchival.DataAccess;
#nullable disable
namespace OpenArchival.DataAccess.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
partial class ArchiveDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("ArtifactEntryArtifactEntry", b =>
{
b.Property("RelatedById")
.HasColumnType("integer");
b.Property("RelatedToId")
.HasColumnType("integer");
b.HasKey("RelatedById", "RelatedToId");
b.HasIndex("RelatedToId");
b.ToTable("ArtifactRelationships", (string)null);
});
modelBuilder.Entity("ArtifactEntryArtifactEntryTag", b =>
{
b.Property("ArtifactEntriesId")
.HasColumnType("integer");
b.Property("TagsId")
.HasColumnType("integer");
b.HasKey("ArtifactEntriesId", "TagsId");
b.HasIndex("TagsId");
b.ToTable("ArtifactEntryArtifactEntryTag");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property("Id")
.HasColumnType("text");
b.Property("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property("Name")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("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", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("ClaimType")
.HasColumnType("text");
b.Property("ClaimValue")
.HasColumnType("text");
b.Property("RoleId")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("ClaimType")
.HasColumnType("text");
b.Property("ClaimValue")
.HasColumnType("text");
b.Property("UserId")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
{
b.Property("LoginProvider")
.HasColumnType("text");
b.Property("ProviderKey")
.HasColumnType("text");
b.Property("ProviderDisplayName")
.HasColumnType("text");
b.Property("UserId")
.IsRequired()
.HasColumnType("text");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
{
b.Property("UserId")
.HasColumnType("text");
b.Property("RoleId")
.HasColumnType("text");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
{
b.Property("UserId")
.HasColumnType("text");
b.Property("LoginProvider")
.HasColumnType("text");
b.Property("Name")
.HasColumnType("text");
b.Property("Value")
.HasColumnType("text");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("OpenArchival.DataAccess.ApplicationUser", b =>
{
b.Property("Id")
.HasColumnType("text");
b.Property("AccessFailedCount")
.HasColumnType("integer");
b.Property("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property("Email")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("EmailConfirmed")
.HasColumnType("boolean");
b.Property("LockoutEnabled")
.HasColumnType("boolean");
b.Property("LockoutEnd")
.HasColumnType("timestamp with time zone");
b.Property("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("PasswordHash")
.HasColumnType("text");
b.Property("PermissionLevel")
.IsRequired()
.HasColumnType("text");
b.Property("PhoneNumber")
.HasColumnType("text");
b.Property("PhoneNumberConfirmed")
.HasColumnType("boolean");
b.Property("SecurityStamp")
.HasColumnType("text");
b.Property("TwoFactorEnabled")
.HasColumnType("boolean");
b.Property("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("OpenArchival.DataAccess.ArchiveCategory", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Description")
.HasColumnType("text");
b.PrimitiveCollection>("FieldDescriptions")
.IsRequired()
.HasColumnType("text[]");
b.PrimitiveCollection>("FieldNames")
.IsRequired()
.HasColumnType("text[]");
b.Property("FieldSeparator")
.IsRequired()
.HasColumnType("text");
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("ArchiveCategories");
});
modelBuilder.Entity("OpenArchival.DataAccess.ArtifactDefect", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("ArtifactEntryId")
.HasColumnType("integer");
b.Property("Description")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("ArtifactEntryId");
b.ToTable("ArtifactDefects");
});
modelBuilder.Entity("OpenArchival.DataAccess.ArtifactEntry", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("ArtifactGroupingId")
.HasColumnType("integer");
b.Property("ArtifactNumber")
.HasColumnType("text");
b.PrimitiveCollection>("AssociatedDates")
.HasColumnType("timestamp with time zone[]");
b.Property("Description")
.HasColumnType("text");
b.Property("FileTextContent")
.HasColumnType("text");
b.Property("IsPubliclyVisible")
.HasColumnType("boolean");
b.PrimitiveCollection>("Links")
.HasColumnType("text[]");
b.Property("StorageLocationId")
.HasColumnType("integer");
b.Property("Title")
.IsRequired()
.HasColumnType("text");
b.Property("TypeId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("ArtifactGroupingId");
b.HasIndex("StorageLocationId");
b.HasIndex("TypeId");
b.ToTable("ArtifactEntries");
});
modelBuilder.Entity("OpenArchival.DataAccess.ArtifactEntryTag", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("ArtifactEntryTags");
});
modelBuilder.Entity("OpenArchival.DataAccess.ArtifactGrouping", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CategoryId")
.HasColumnType("integer");
b.Property("Description")
.HasColumnType("text");
b.Property("IsPublicallyVisible")
.HasColumnType("boolean");
b.Property("Title")
.IsRequired()
.HasColumnType("text");
b.Property("Type")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("CategoryId");
b.ToTable("ArtifactGroupings");
});
modelBuilder.Entity("OpenArchival.DataAccess.ArtifactStorageLocation", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Location")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("ArtifactStorageLocations");
});
modelBuilder.Entity("OpenArchival.DataAccess.ArtifactType", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("ArtifactTypes");
});
modelBuilder.Entity("OpenArchival.DataAccess.FilePathListing", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("OriginalName")
.IsRequired()
.HasColumnType("text");
b.Property("ParentArtifactEntryId")
.HasColumnType("integer");
b.Property("Path")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("ParentArtifactEntryId");
b.ToTable("ArtifactFilePaths");
});
modelBuilder.Entity("OpenArchival.DataAccess.ListedName", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("ParentArtifactEntryId")
.HasColumnType("integer");
b.Property("Value")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("ParentArtifactEntryId");
b.ToTable("ArtifactAssociatedNames");
});
modelBuilder.Entity("ArtifactEntryArtifactEntry", b =>
{
b.HasOne("OpenArchival.DataAccess.ArtifactEntry", null)
.WithMany()
.HasForeignKey("RelatedById")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("OpenArchival.DataAccess.ArtifactEntry", null)
.WithMany()
.HasForeignKey("RelatedToId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("ArtifactEntryArtifactEntryTag", b =>
{
b.HasOne("OpenArchival.DataAccess.ArtifactEntry", null)
.WithMany()
.HasForeignKey("ArtifactEntriesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("OpenArchival.DataAccess.ArtifactEntryTag", null)
.WithMany()
.HasForeignKey("TagsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
{
b.HasOne("OpenArchival.DataAccess.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
{
b.HasOne("OpenArchival.DataAccess.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("OpenArchival.DataAccess.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
{
b.HasOne("OpenArchival.DataAccess.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("OpenArchival.DataAccess.ArtifactDefect", b =>
{
b.HasOne("OpenArchival.DataAccess.ArtifactEntry", null)
.WithMany("Defects")
.HasForeignKey("ArtifactEntryId");
});
modelBuilder.Entity("OpenArchival.DataAccess.ArtifactEntry", b =>
{
b.HasOne("OpenArchival.DataAccess.ArtifactGrouping", "ArtifactGrouping")
.WithMany("ChildArtifactEntries")
.HasForeignKey("ArtifactGroupingId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("OpenArchival.DataAccess.ArtifactStorageLocation", "StorageLocation")
.WithMany()
.HasForeignKey("StorageLocationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("OpenArchival.DataAccess.ArtifactType", "Type")
.WithMany()
.HasForeignKey("TypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ArtifactGrouping");
b.Navigation("StorageLocation");
b.Navigation("Type");
});
modelBuilder.Entity("OpenArchival.DataAccess.ArtifactGrouping", b =>
{
b.HasOne("OpenArchival.DataAccess.ArchiveCategory", "Category")
.WithMany()
.HasForeignKey("CategoryId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.OwnsOne("OpenArchival.DataAccess.IdentifierFields", "IdentifierFields", b1 =>
{
b1.Property("ArtifactGroupingId")
.HasColumnType("integer");
b1.PrimitiveCollection>("Values")
.IsRequired()
.HasColumnType("text[]");
b1.HasKey("ArtifactGroupingId");
b1.ToTable("ArtifactGroupings");
b1.ToJson("IdentifierFields");
b1.WithOwner()
.HasForeignKey("ArtifactGroupingId");
});
b.Navigation("Category");
b.Navigation("IdentifierFields")
.IsRequired();
});
modelBuilder.Entity("OpenArchival.DataAccess.FilePathListing", b =>
{
b.HasOne("OpenArchival.DataAccess.ArtifactEntry", "ParentArtifactEntry")
.WithMany("Files")
.HasForeignKey("ParentArtifactEntryId");
b.Navigation("ParentArtifactEntry");
});
modelBuilder.Entity("OpenArchival.DataAccess.ListedName", b =>
{
b.HasOne("OpenArchival.DataAccess.ArtifactEntry", "ParentArtifactEntry")
.WithMany("ListedNames")
.HasForeignKey("ParentArtifactEntryId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ParentArtifactEntry");
});
modelBuilder.Entity("OpenArchival.DataAccess.ArtifactEntry", b =>
{
b.Navigation("Defects");
b.Navigation("Files");
b.Navigation("ListedNames");
});
modelBuilder.Entity("OpenArchival.DataAccess.ArtifactGrouping", b =>
{
b.Navigation("ChildArtifactEntries");
});
#pragma warning restore 612, 618
}
}
}