diff options
| author | Jake Mannens <jake@asger.xyz> | 2024-02-05 16:02:02 +1100 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2024-02-05 16:02:02 +1100 |
| commit | f7490260d5815b7bbce0d3ea03898b2cc754bdce (patch) | |
| tree | f33ac49cb0017aadbc294b3172248096f91037fc /Migrations/HBContextModelSnapshot.cs | |
| parent | 226538299372624c10450e203cefc665fcb439a2 (diff) | |
Added security migration
Diffstat (limited to 'Migrations/HBContextModelSnapshot.cs')
| -rw-r--r-- | Migrations/HBContextModelSnapshot.cs | 174 |
1 files changed, 154 insertions, 20 deletions
diff --git a/Migrations/HBContextModelSnapshot.cs b/Migrations/HBContextModelSnapshot.cs index 5d2cf4c..0793fdb 100644 --- a/Migrations/HBContextModelSnapshot.cs +++ b/Migrations/HBContextModelSnapshot.cs @@ -17,11 +17,52 @@ namespace HyperBooru.Migrations { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "7.0.10") + .HasAnnotation("ProductVersion", "7.0.12") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + modelBuilder.Entity("HyperBooru.Acl", b => + { + b.Property<int>("AclId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("AclId")); + + b.HasKey("AclId"); + + b.ToTable("Acls"); + }); + + modelBuilder.Entity("HyperBooru.AclRule", b => + { + b.Property<int>("AclRuleId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("AclRuleId")); + + b.Property<int?>("AclId") + .HasColumnType("integer"); + + b.Property<int>("Action") + .HasColumnType("integer"); + + b.Property<long>("Permissions") + .HasColumnType("bigint"); + + b.Property<string>("Principal") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("AclRuleId"); + + b.HasIndex("AclId"); + + b.ToTable("AclRules"); + }); + modelBuilder.Entity("HyperBooru.HBObject", b => { b.Property<int>("ObjectId") @@ -30,11 +71,23 @@ namespace HyperBooru.Migrations NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("ObjectId")); + b.Property<int?>("AclId") + .HasColumnType("integer"); + b.Property<Guid>("Guid") .HasColumnType("uuid"); + b.Property<string>("Owner") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("text") + .HasDefaultValue("S-1-1-0"); + b.HasKey("ObjectId"); + b.HasIndex("AclId") + .IsUnique(); + b.HasIndex("Guid"); b.ToTable("Objects", (string)null); @@ -42,6 +95,39 @@ namespace HyperBooru.Migrations b.UseTptMappingStrategy(); }); + modelBuilder.Entity("HyperBooru.LocalPrincipal", b => + { + b.Property<int>("LocalPrincipalId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("LocalPrincipalId")); + + b.Property<string>("Discriminator") + .IsRequired() + .HasColumnType("text"); + + b.Property<string>("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property<string>("Sid") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("LocalPrincipalId"); + + b.HasIndex("Name"); + + b.HasIndex("Sid"); + + b.ToTable("SecurityPrincipals", (string)null); + + b.HasDiscriminator<string>("Discriminator").HasValue("LocalPrincipal"); + + b.UseTphMappingStrategy(); + }); + modelBuilder.Entity("HyperBooru.OcrData", b => { b.Property<int>("OcrDataId") @@ -72,6 +158,21 @@ namespace HyperBooru.Migrations b.ToTable("OcrData"); }); + modelBuilder.Entity("LocalGroupLocalPrincipal", b => + { + b.Property<int>("LocalPrincipalId") + .HasColumnType("integer"); + + b.Property<int>("MemberOfLocalPrincipalId") + .HasColumnType("integer"); + + b.HasKey("LocalPrincipalId", "MemberOfLocalPrincipalId"); + + b.HasIndex("MemberOfLocalPrincipalId"); + + b.ToTable("SecurityPrincipalMemberships", (string)null); + }); + modelBuilder.Entity("TagDefinitionTagDefinition", b => { b.Property<int>("ImplicitTagsObjectId") @@ -84,7 +185,7 @@ namespace HyperBooru.Migrations b.HasIndex("TagDefinitionObjectId"); - b.ToTable("TagDefinitionTagDefinition"); + b.ToTable("ImplicitTags", (string)null); }); modelBuilder.Entity("HyperBooru.Media", b => @@ -150,6 +251,7 @@ namespace HyperBooru.Migrations { ObjectId = -1, Guid = new Guid("ebdad4f8-455a-4351-8017-1d4854d6fa38"), + Owner = "S-1-1-0", Name = "nsfw", Source = 0 }, @@ -157,6 +259,7 @@ namespace HyperBooru.Migrations { ObjectId = -2, Guid = new Guid("ea212801-5bcc-4c0e-814f-fb9d30db58bc"), + Owner = "S-1-1-0", Name = "ingest", Source = 0 }); @@ -209,32 +312,49 @@ namespace HyperBooru.Migrations b.ToTable("UploadedFiles", (string)null); }); - modelBuilder.Entity("HyperBooru.User", b => + modelBuilder.Entity("HyperBooru.LocalGroup", b => { - b.HasBaseType("HyperBooru.HBObject"); + b.HasBaseType("HyperBooru.LocalPrincipal"); - b.Property<string>("PasswordHash") - .IsRequired() - .HasColumnType("text"); + b.HasDiscriminator().HasValue("LocalGroup"); + }); - b.Property<string>("Username") + modelBuilder.Entity("HyperBooru.LocalUser", b => + { + b.HasBaseType("HyperBooru.LocalPrincipal"); + + b.Property<string>("PasswordHash") .IsRequired() .HasColumnType("text"); - b.HasIndex("Username"); - - b.ToTable("Users"); + b.HasDiscriminator().HasValue("LocalUser"); b.HasData( new { - ObjectId = -3, - Guid = new Guid("4fa948f4-7c45-4f81-bb6b-e417491e6c96"), - PasswordHash = "P4geAuE2yX/PDRHuJSq74FF5vO782rWz5c0LAQPR8m45DEYAONhu1wYnAn60PSNyjocqEBdnCeKCJfK3sKyuWw==", - Username = "admin" + LocalPrincipalId = -1, + Name = "Administrator", + Sid = "S-1-5-18", + PasswordHash = "P4geAuE2yX/PDRHuJSq74FF5vO782rWz5c0LAQPR8m45DEYAONhu1wYnAn60PSNyjocqEBdnCeKCJfK3sKyuWw==" }); }); + 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") @@ -246,6 +366,21 @@ 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) @@ -327,12 +462,11 @@ namespace HyperBooru.Migrations b.Navigation("Media"); }); - modelBuilder.Entity("HyperBooru.User", b => + modelBuilder.Entity("HyperBooru.Acl", b => { - b.HasOne("HyperBooru.HBObject", null) - .WithOne() - .HasForeignKey("HyperBooru.User", "ObjectId") - .OnDelete(DeleteBehavior.Cascade) + b.Navigation("Rules"); + + b.Navigation("Subject") .IsRequired(); }); |
