From 226538299372624c10450e203cefc665fcb439a2 Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Mon, 5 Feb 2024 15:33:27 +1100 Subject: Removed security migrations --- Migrations/HBContextModelSnapshot.cs | 174 ++++------------------------------- 1 file changed, 20 insertions(+), 154 deletions(-) (limited to 'Migrations/HBContextModelSnapshot.cs') diff --git a/Migrations/HBContextModelSnapshot.cs b/Migrations/HBContextModelSnapshot.cs index 9341db6..5d2cf4c 100644 --- a/Migrations/HBContextModelSnapshot.cs +++ b/Migrations/HBContextModelSnapshot.cs @@ -17,52 +17,11 @@ namespace HyperBooru.Migrations { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "7.0.12") + .HasAnnotation("ProductVersion", "7.0.10") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - modelBuilder.Entity("HyperBooru.Acl", b => - { - b.Property("AclId") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("AclId")); - - b.HasKey("AclId"); - - b.ToTable("Acls"); - }); - - modelBuilder.Entity("HyperBooru.AclRule", b => - { - b.Property("AclRuleId") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("AclRuleId")); - - b.Property("AclId") - .HasColumnType("integer"); - - b.Property("Action") - .HasColumnType("integer"); - - b.Property("Permissions") - .HasColumnType("bigint"); - - b.Property("Principal") - .IsRequired() - .HasColumnType("bytea"); - - b.HasKey("AclRuleId"); - - b.HasIndex("AclId"); - - b.ToTable("AclRules"); - }); - modelBuilder.Entity("HyperBooru.HBObject", b => { b.Property("ObjectId") @@ -71,23 +30,11 @@ namespace HyperBooru.Migrations NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ObjectId")); - b.Property("AclId") - .HasColumnType("integer"); - b.Property("Guid") .HasColumnType("uuid"); - b.Property("Owner") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("bytea") - .HasDefaultValue(new byte[] { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 }); - b.HasKey("ObjectId"); - b.HasIndex("AclId") - .IsUnique(); - b.HasIndex("Guid"); b.ToTable("Objects", (string)null); @@ -95,39 +42,6 @@ namespace HyperBooru.Migrations b.UseTptMappingStrategy(); }); - modelBuilder.Entity("HyperBooru.LocalPrincipal", b => - { - b.Property("LocalPrincipalId") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("LocalPrincipalId")); - - b.Property("Discriminator") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Sid") - .IsRequired() - .HasColumnType("bytea"); - - b.HasKey("LocalPrincipalId"); - - b.HasIndex("Name"); - - b.HasIndex("Sid"); - - b.ToTable("SecurityPrincipals", (string)null); - - b.HasDiscriminator("Discriminator").HasValue("LocalPrincipal"); - - b.UseTphMappingStrategy(); - }); - modelBuilder.Entity("HyperBooru.OcrData", b => { b.Property("OcrDataId") @@ -158,21 +72,6 @@ namespace HyperBooru.Migrations b.ToTable("OcrData"); }); - modelBuilder.Entity("LocalGroupLocalPrincipal", b => - { - b.Property("LocalPrincipalId") - .HasColumnType("integer"); - - b.Property("MemberOfLocalPrincipalId") - .HasColumnType("integer"); - - b.HasKey("LocalPrincipalId", "MemberOfLocalPrincipalId"); - - b.HasIndex("MemberOfLocalPrincipalId"); - - b.ToTable("SecurityPrincipalMemberships", (string)null); - }); - modelBuilder.Entity("TagDefinitionTagDefinition", b => { b.Property("ImplicitTagsObjectId") @@ -185,7 +84,7 @@ namespace HyperBooru.Migrations b.HasIndex("TagDefinitionObjectId"); - b.ToTable("ImplicitTags", (string)null); + b.ToTable("TagDefinitionTagDefinition"); }); modelBuilder.Entity("HyperBooru.Media", b => @@ -251,7 +150,6 @@ namespace HyperBooru.Migrations { ObjectId = -1, Guid = new Guid("ebdad4f8-455a-4351-8017-1d4854d6fa38"), - Owner = new byte[] { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 }, Name = "nsfw", Source = 0 }, @@ -259,7 +157,6 @@ namespace HyperBooru.Migrations { ObjectId = -2, Guid = new Guid("ea212801-5bcc-4c0e-814f-fb9d30db58bc"), - Owner = new byte[] { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 }, Name = "ingest", Source = 0 }); @@ -312,49 +209,32 @@ namespace HyperBooru.Migrations b.ToTable("UploadedFiles", (string)null); }); - modelBuilder.Entity("HyperBooru.LocalGroup", b => + modelBuilder.Entity("HyperBooru.User", b => { - b.HasBaseType("HyperBooru.LocalPrincipal"); - - b.HasDiscriminator().HasValue("LocalGroup"); - }); - - modelBuilder.Entity("HyperBooru.LocalUser", b => - { - b.HasBaseType("HyperBooru.LocalPrincipal"); + b.HasBaseType("HyperBooru.HBObject"); b.Property("PasswordHash") .IsRequired() .HasColumnType("text"); - b.HasDiscriminator().HasValue("LocalUser"); + b.Property("Username") + .IsRequired() + .HasColumnType("text"); + + b.HasIndex("Username"); + + b.ToTable("Users"); b.HasData( new { - LocalPrincipalId = -1, - Name = "Administrator", - Sid = new byte[] { 1, 1, 0, 0, 0, 0, 0, 5, 18, 0, 0, 0 }, - PasswordHash = "P4geAuE2yX/PDRHuJSq74FF5vO782rWz5c0LAQPR8m45DEYAONhu1wYnAn60PSNyjocqEBdnCeKCJfK3sKyuWw==" + ObjectId = -3, + Guid = new Guid("4fa948f4-7c45-4f81-bb6b-e417491e6c96"), + PasswordHash = "P4geAuE2yX/PDRHuJSq74FF5vO782rWz5c0LAQPR8m45DEYAONhu1wYnAn60PSNyjocqEBdnCeKCJfK3sKyuWw==", + Username = "admin" }); }); - modelBuilder.Entity("HyperBooru.AclRule", b => - { - b.HasOne("HyperBooru.Acl", null) - .WithMany("Rules") - .HasForeignKey("AclId"); - }); - - modelBuilder.Entity("HyperBooru.HBObject", b => - { - b.HasOne("HyperBooru.Acl", "Acl") - .WithOne("Subject") - .HasForeignKey("HyperBooru.HBObject", "AclId"); - - b.Navigation("Acl"); - }); - modelBuilder.Entity("HyperBooru.OcrData", b => { b.HasOne("HyperBooru.Media", "Media") @@ -366,21 +246,6 @@ namespace HyperBooru.Migrations b.Navigation("Media"); }); - modelBuilder.Entity("LocalGroupLocalPrincipal", b => - { - b.HasOne("HyperBooru.LocalPrincipal", null) - .WithMany() - .HasForeignKey("LocalPrincipalId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("HyperBooru.LocalGroup", null) - .WithMany() - .HasForeignKey("MemberOfLocalPrincipalId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - modelBuilder.Entity("TagDefinitionTagDefinition", b => { b.HasOne("HyperBooru.TagDefinition", null) @@ -462,11 +327,12 @@ namespace HyperBooru.Migrations b.Navigation("Media"); }); - modelBuilder.Entity("HyperBooru.Acl", b => + modelBuilder.Entity("HyperBooru.User", b => { - b.Navigation("Rules"); - - b.Navigation("Subject") + b.HasOne("HyperBooru.HBObject", null) + .WithOne() + .HasForeignKey("HyperBooru.User", "ObjectId") + .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); -- cgit v1.3