From 727dcaacc6df8813a9296ac858dd51d11f3737b8 Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Thu, 17 Aug 2023 09:36:09 +1000 Subject: Update DB schema to fix implicit tags bug --- Migrations/HBContextModelSnapshot.cs | 48 ++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 16 deletions(-) (limited to 'Migrations/HBContextModelSnapshot.cs') diff --git a/Migrations/HBContextModelSnapshot.cs b/Migrations/HBContextModelSnapshot.cs index 9697e16..06712a6 100644 --- a/Migrations/HBContextModelSnapshot.cs +++ b/Migrations/HBContextModelSnapshot.cs @@ -74,6 +74,21 @@ namespace HyperBooru.Migrations b.ToTable("UploadedFiles", (string)null); }); + modelBuilder.Entity("TagDefinitionTagDefinition", b => + { + b.Property("ImplicitTagsObjectId") + .HasColumnType("INTEGER"); + + b.Property("TagDefinitionObjectId") + .HasColumnType("INTEGER"); + + b.HasKey("ImplicitTagsObjectId", "TagDefinitionObjectId"); + + b.HasIndex("TagDefinitionObjectId"); + + b.ToTable("TagDefinitionTagDefinition"); + }); + modelBuilder.Entity("HyperBooru.Media", b => { b.HasBaseType("HyperBooru.HBObject"); @@ -129,25 +144,20 @@ namespace HyperBooru.Migrations 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"), + Guid = new Guid("13399c38-34b8-44a1-ac42-536bd32de96a"), Name = "nsfw", Source = 0 }, new { ObjectId = -2, - Guid = new Guid("716ac11f-135a-433c-84a7-7bdfddbec004"), + Guid = new Guid("8b9cd13c-422a-4958-b97e-b858ac9301db"), Name = "ingest", Source = 0 }); @@ -164,6 +174,21 @@ namespace HyperBooru.Migrations b.Navigation("Media"); }); + modelBuilder.Entity("TagDefinitionTagDefinition", b => + { + b.HasOne("HyperBooru.TagDefinition", null) + .WithMany() + .HasForeignKey("ImplicitTagsObjectId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("HyperBooru.TagDefinition", null) + .WithMany() + .HasForeignKey("TagDefinitionObjectId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + modelBuilder.Entity("HyperBooru.Media", b => { b.HasOne("HyperBooru.HBObject", null) @@ -205,10 +230,6 @@ namespace HyperBooru.Migrations .HasForeignKey("HyperBooru.TagDefinition", "ObjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - - b.HasOne("HyperBooru.TagDefinition", null) - .WithMany("ImplicitTags") - .HasForeignKey("TagDefinitionObjectId"); }); modelBuilder.Entity("HyperBooru.HBObject", b => @@ -220,11 +241,6 @@ namespace HyperBooru.Migrations { b.Navigation("UploadedFiles"); }); - - modelBuilder.Entity("HyperBooru.TagDefinition", b => - { - b.Navigation("ImplicitTags"); - }); #pragma warning restore 612, 618 } } -- cgit v1.3