summaryrefslogtreecommitdiff
path: root/Migrations/HBContextModelSnapshot.cs
diff options
context:
space:
mode:
authorJake Mannens <jake@asger.xyz>2023-10-03 16:41:58 +1100
committerJake Mannens <jake@asger.xyz>2023-10-03 16:41:58 +1100
commit33438ac951430fa370965b42a3d98a54e704ab01 (patch)
treefbd835c25ac7566e8437cd0ef988fce0596a15e7 /Migrations/HBContextModelSnapshot.cs
parent7170867a9a2650fa5a98b9e2664fb2114a0bf114 (diff)
AclDialog
Diffstat (limited to 'Migrations/HBContextModelSnapshot.cs')
-rw-r--r--Migrations/HBContextModelSnapshot.cs176
1 files changed, 155 insertions, 21 deletions
diff --git a/Migrations/HBContextModelSnapshot.cs b/Migrations/HBContextModelSnapshot.cs
index 16e6b48..3e49681 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.11")
.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<byte[]>("Principal")
+ .IsRequired()
+ .HasColumnType("bytea");
+
+ 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<byte[]>("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);
@@ -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<byte[]>("Sid")
+ .IsRequired()
+ .HasColumnType("bytea");
+
+ 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")
@@ -69,7 +155,22 @@ namespace HyperBooru.Migrations
b.HasIndex("MediaId")
.IsUnique();
- b.ToTable("OcrData", (string)null);
+ 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 =>
@@ -84,7 +185,7 @@ namespace HyperBooru.Migrations
b.HasIndex("TagDefinitionObjectId");
- b.ToTable("TagDefinitionTagDefinition", (string)null);
+ 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 = new byte[] { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
Name = "nsfw",
Source = 0
},
@@ -157,6 +259,7 @@ 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
});
@@ -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", (string)null);
+ 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 = "admin",
+ Sid = new byte[] { 1, 1, 0, 0, 0, 0, 0, 5, 18, 0, 0, 0 },
+ 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)
@@ -329,12 +464,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();
});