// using System; using HyperBooru; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; #nullable disable namespace HyperBooru.Migrations { [DbContext(typeof(HBContext))] [Migration("20230814013743_Initial")] partial class Initial { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "7.0.10") .HasAnnotation("Proxies:ChangeTracking", false) .HasAnnotation("Proxies:CheckEquality", false) .HasAnnotation("Proxies:LazyLoading", true); modelBuilder.Entity("HyperBooru.HBObject", b => { b.Property("ObjectId") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Guid") .HasColumnType("TEXT"); b.HasKey("ObjectId"); b.HasIndex("Guid"); b.ToTable("Objects", (string)null); b.UseTptMappingStrategy(); }); modelBuilder.Entity("HyperBooru.UploadedFile", b => { b.Property("UploadedFileId") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("CreateTime") .HasColumnType("TEXT"); b.Property("Filename") .HasColumnType("TEXT"); b.Property("LastAccessTime") .HasColumnType("TEXT"); b.Property("LastWriteTime") .HasColumnType("TEXT"); b.Property("MediaObjectId") .HasColumnType("INTEGER"); b.Property("OriginalChecksum") .IsRequired() .HasColumnType("TEXT"); b.Property("UploadTime") .HasColumnType("TEXT"); b.HasKey("UploadedFileId"); b.HasIndex("MediaObjectId"); b.ToTable("UploadedFiles", (string)null); }); modelBuilder.Entity("HyperBooru.Media", b => { b.HasBaseType("HyperBooru.HBObject"); b.Property("Checksum") .IsRequired() .HasColumnType("TEXT"); b.Property("LongDescription") .HasColumnType("TEXT"); b.Property("MimeType") .IsRequired() .HasColumnType("TEXT"); b.Property("ShortDescription") .HasColumnType("TEXT"); b.ToTable("Media", (string)null); }); modelBuilder.Entity("HyperBooru.Tag", b => { b.HasBaseType("HyperBooru.HBObject"); b.Property("CreateTime") .HasColumnType("TEXT"); b.Property("TagDefinitionObjectId") .HasColumnType("INTEGER"); b.Property("TargetObjectId") .HasColumnType("INTEGER"); b.HasIndex("TagDefinitionObjectId"); b.HasIndex("TargetObjectId"); b.ToTable("Tags", (string)null); }); modelBuilder.Entity("HyperBooru.TagDefinition", b => { b.HasBaseType("HyperBooru.HBObject"); b.Property("Name") .IsRequired() .HasColumnType("TEXT"); b.Property("Namespace") .HasColumnType("TEXT"); b.Property("Source") .HasColumnType("INTEGER"); b.Property("TagDefinitionObjectId") .HasColumnType("INTEGER"); b.HasIndex("TagDefinitionObjectId"); b.ToTable("TagDefinitions", (string)null); b.HasData( new { ObjectId = -1, Guid = new Guid("cbd871cb-8790-4519-9f74-90d1e13a48a0"), Name = "nsfw", Source = 0 }, new { ObjectId = -2, Guid = new Guid("716ac11f-135a-433c-84a7-7bdfddbec004"), Name = "ingest", Source = 0 }); }); modelBuilder.Entity("HyperBooru.UploadedFile", b => { b.HasOne("HyperBooru.Media", "Media") .WithMany("UploadedFiles") .HasForeignKey("MediaObjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Media"); }); modelBuilder.Entity("HyperBooru.Media", b => { b.HasOne("HyperBooru.HBObject", null) .WithOne() .HasForeignKey("HyperBooru.Media", "ObjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("HyperBooru.Tag", b => { b.HasOne("HyperBooru.HBObject", null) .WithOne() .HasForeignKey("HyperBooru.Tag", "ObjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("HyperBooru.TagDefinition", "TagDefinition") .WithMany() .HasForeignKey("TagDefinitionObjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("HyperBooru.HBObject", "Target") .WithMany("Tags") .HasForeignKey("TargetObjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("TagDefinition"); b.Navigation("Target"); }); modelBuilder.Entity("HyperBooru.TagDefinition", b => { b.HasOne("HyperBooru.HBObject", null) .WithOne() .HasForeignKey("HyperBooru.TagDefinition", "ObjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("HyperBooru.TagDefinition", null) .WithMany("ImplicitTags") .HasForeignKey("TagDefinitionObjectId"); }); modelBuilder.Entity("HyperBooru.HBObject", b => { b.Navigation("Tags"); }); modelBuilder.Entity("HyperBooru.Media", b => { b.Navigation("UploadedFiles"); }); modelBuilder.Entity("HyperBooru.TagDefinition", b => { b.Navigation("ImplicitTags"); }); #pragma warning restore 612, 618 } } }