summaryrefslogtreecommitdiff
path: root/Migrations/HBContextModelSnapshot.cs
diff options
context:
space:
mode:
authorJake Mannens <jake@asger.xyz>2023-09-20 12:45:59 +1000
committerJake Mannens <jake@asger.xyz>2023-09-20 12:45:59 +1000
commitfbaa4e43709a96774ebe42b7ec5908c1c0f310d7 (patch)
tree04293c8a78911f0180f9ab862365cc12fa7bcc43 /Migrations/HBContextModelSnapshot.cs
parentccad8db591129f5a9effb6469b477bb5c23ee229 (diff)
Added security migration
Diffstat (limited to 'Migrations/HBContextModelSnapshot.cs')
-rw-r--r--Migrations/HBContextModelSnapshot.cs119
1 files changed, 108 insertions, 11 deletions
diff --git a/Migrations/HBContextModelSnapshot.cs b/Migrations/HBContextModelSnapshot.cs
index 5dc4d8d..da4c444 100644
--- a/Migrations/HBContextModelSnapshot.cs
+++ b/Migrations/HBContextModelSnapshot.cs
@@ -87,6 +87,52 @@ namespace HyperBooru.Migrations
b.ToTable("TagDefinitionTagDefinition");
});
+ modelBuilder.Entity("HyperBooru.Acl", b =>
+ {
+ b.HasBaseType("HyperBooru.HBObject");
+
+ b.Property<int?>("SubjectTempId1")
+ .HasColumnType("integer");
+
+ b.ToTable("Acls");
+ });
+
+ modelBuilder.Entity("HyperBooru.AclRule", b =>
+ {
+ b.HasBaseType("HyperBooru.HBObject");
+
+ b.Property<int?>("AclObjectId")
+ .HasColumnType("integer");
+
+ b.Property<int>("Action")
+ .HasColumnType("integer");
+
+ b.Property<decimal>("Permissions")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property<int>("PrincipalObjectId")
+ .HasColumnType("integer");
+
+ b.HasIndex("AclObjectId");
+
+ b.HasIndex("PrincipalObjectId");
+
+ b.ToTable("AclRules");
+ });
+
+ modelBuilder.Entity("HyperBooru.HBPrincipal", b =>
+ {
+ b.HasBaseType("HyperBooru.HBObject");
+
+ b.Property<string>("Name")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasIndex("Name");
+
+ b.ToTable("Principals");
+ });
+
modelBuilder.Entity("HyperBooru.Media", b =>
{
b.HasBaseType("HyperBooru.HBObject");
@@ -209,29 +255,35 @@ namespace HyperBooru.Migrations
b.ToTable("UploadedFiles", (string)null);
});
+ modelBuilder.Entity("HyperBooru.Group", b =>
+ {
+ b.HasBaseType("HyperBooru.HBPrincipal");
+
+ b.Property<int?>("HBPrincipalObjectId")
+ .HasColumnType("integer");
+
+ b.HasIndex("HBPrincipalObjectId");
+
+ b.ToTable("Groups");
+ });
+
modelBuilder.Entity("HyperBooru.User", b =>
{
- b.HasBaseType("HyperBooru.HBObject");
+ b.HasBaseType("HyperBooru.HBPrincipal");
b.Property<string>("PasswordHash")
.IsRequired()
.HasColumnType("text");
- b.Property<string>("Username")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasIndex("Username");
-
b.ToTable("Users");
b.HasData(
new
{
ObjectId = -3,
- Guid = new Guid("4fa948f4-7c45-4f81-bb6b-e417491e6c96"),
- PasswordHash = "P4geAuE2yX/PDRHuJSq74FF5vO782rWz5c0LAQPR8m45DEYAONhu1wYnAn60PSNyjocqEBdnCeKCJfK3sKyuWw==",
- Username = "admin"
+ Guid = new Guid("bf62bd4c-806e-4d1b-a62d-0efffce8628a"),
+ Name = "admin",
+ PasswordHash = "P4geAuE2yX/PDRHuJSq74FF5vO782rWz5c0LAQPR8m45DEYAONhu1wYnAn60PSNyjocqEBdnCeKCJfK3sKyuWw=="
});
});
@@ -261,6 +313,32 @@ namespace HyperBooru.Migrations
.IsRequired();
});
+ modelBuilder.Entity("HyperBooru.Acl", b =>
+ {
+ b.HasOne("HyperBooru.HBObject", "Subject")
+ .WithOne("Acl")
+ .HasForeignKey("HyperBooru.Acl", "ObjectId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Subject");
+ });
+
+ modelBuilder.Entity("HyperBooru.AclRule", b =>
+ {
+ b.HasOne("HyperBooru.Acl", null)
+ .WithMany("Rules")
+ .HasForeignKey("AclObjectId");
+
+ b.HasOne("HyperBooru.HBPrincipal", "Principal")
+ .WithMany()
+ .HasForeignKey("PrincipalObjectId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Principal");
+ });
+
modelBuilder.Entity("HyperBooru.Media", b =>
{
b.HasOne("HyperBooru.UploadedFile", "CurrentUploadedFile")
@@ -329,9 +407,16 @@ namespace HyperBooru.Migrations
b.Navigation("Media");
});
+ modelBuilder.Entity("HyperBooru.Group", b =>
+ {
+ b.HasOne("HyperBooru.HBPrincipal", null)
+ .WithMany("MemberOf")
+ .HasForeignKey("HBPrincipalObjectId");
+ });
+
modelBuilder.Entity("HyperBooru.User", b =>
{
- b.HasOne("HyperBooru.HBObject", null)
+ b.HasOne("HyperBooru.HBPrincipal", null)
.WithOne()
.HasForeignKey("HyperBooru.User", "ObjectId")
.OnDelete(DeleteBehavior.Cascade)
@@ -340,9 +425,21 @@ namespace HyperBooru.Migrations
modelBuilder.Entity("HyperBooru.HBObject", b =>
{
+ b.Navigation("Acl");
+
b.Navigation("Tags");
});
+ modelBuilder.Entity("HyperBooru.Acl", b =>
+ {
+ b.Navigation("Rules");
+ });
+
+ modelBuilder.Entity("HyperBooru.HBPrincipal", b =>
+ {
+ b.Navigation("MemberOf");
+ });
+
modelBuilder.Entity("HyperBooru.Media", b =>
{
b.Navigation("OcrData");