From 33a3c4d57d774d98c3836c98ecbd2e1dd5ea84c3 Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Wed, 6 Sep 2023 02:46:10 +1000 Subject: Added pointer to current UploadedFile on Media --- Migrations/HBContextModelSnapshot.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Migrations/HBContextModelSnapshot.cs') diff --git a/Migrations/HBContextModelSnapshot.cs b/Migrations/HBContextModelSnapshot.cs index 3211e1f..81ee485 100644 --- a/Migrations/HBContextModelSnapshot.cs +++ b/Migrations/HBContextModelSnapshot.cs @@ -95,6 +95,9 @@ namespace HyperBooru.Migrations .IsRequired() .HasColumnType("text"); + b.Property("CurrentUploadedFileId") + .HasColumnType("integer"); + b.Property("Height") .HasColumnType("integer"); @@ -111,6 +114,9 @@ namespace HyperBooru.Migrations b.Property("Width") .HasColumnType("integer"); + b.HasIndex("CurrentUploadedFileId") + .IsUnique(); + b.ToTable("Media", (string)null); }); @@ -235,11 +241,19 @@ namespace HyperBooru.Migrations modelBuilder.Entity("HyperBooru.Media", b => { + b.HasOne("HyperBooru.UploadedFile", "CurrentUploadedFile") + .WithOne() + .HasForeignKey("HyperBooru.Media", "CurrentUploadedFileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + b.HasOne("HyperBooru.HBObject", null) .WithOne() .HasForeignKey("HyperBooru.Media", "ObjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); + + b.Navigation("CurrentUploadedFile"); }); modelBuilder.Entity("HyperBooru.Tag", b => -- cgit v1.3