summaryrefslogtreecommitdiff
path: root/Migrations
diff options
context:
space:
mode:
Diffstat (limited to 'Migrations')
-rw-r--r--Migrations/20230920014958_Security.Designer.cs455
-rw-r--r--Migrations/20230920014958_Security.cs194
-rw-r--r--Migrations/HBContextModelSnapshot.cs119
3 files changed, 757 insertions, 11 deletions
diff --git a/Migrations/20230920014958_Security.Designer.cs b/Migrations/20230920014958_Security.Designer.cs
new file mode 100644
index 0000000..7933a93
--- /dev/null
+++ b/Migrations/20230920014958_Security.Designer.cs
@@ -0,0 +1,455 @@
+// <auto-generated />
+using System;
+using HyperBooru;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace HyperBooru.Migrations
+{
+ [DbContext(typeof(HBContext))]
+ [Migration("20230920014958_Security")]
+ partial class Security
+ {
+ /// <inheritdoc />
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "7.0.10")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("HyperBooru.HBObject", b =>
+ {
+ b.Property<int>("ObjectId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("ObjectId"));
+
+ b.Property<Guid>("Guid")
+ .HasColumnType("uuid");
+
+ b.HasKey("ObjectId");
+
+ b.HasIndex("Guid");
+
+ b.ToTable("Objects", (string)null);
+
+ b.UseTptMappingStrategy();
+ });
+
+ modelBuilder.Entity("HyperBooru.OcrData", b =>
+ {
+ b.Property<int>("OcrDataId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("OcrDataId"));
+
+ b.Property<int>("MediaId")
+ .HasColumnType("integer");
+
+ b.Property<string>("SearchableText")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property<string>("Text")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property<DateTime>("Timestamp")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("OcrDataId");
+
+ b.HasIndex("MediaId")
+ .IsUnique();
+
+ b.ToTable("OcrData");
+ });
+
+ modelBuilder.Entity("TagDefinitionTagDefinition", b =>
+ {
+ b.Property<int>("ImplicitTagsObjectId")
+ .HasColumnType("integer");
+
+ b.Property<int>("TagDefinitionObjectId")
+ .HasColumnType("integer");
+
+ b.HasKey("ImplicitTagsObjectId", "TagDefinitionObjectId");
+
+ b.HasIndex("TagDefinitionObjectId");
+
+ 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");
+
+ b.Property<int>("CurrentUploadedFileId")
+ .HasColumnType("integer");
+
+ b.Property<string>("LongDescription")
+ .HasColumnType("text");
+
+ b.Property<string>("ShortDescription")
+ .HasColumnType("text");
+
+ b.HasIndex("CurrentUploadedFileId")
+ .IsUnique();
+
+ b.ToTable("Media", (string)null);
+ });
+
+ modelBuilder.Entity("HyperBooru.Tag", b =>
+ {
+ b.HasBaseType("HyperBooru.HBObject");
+
+ b.Property<DateTime>("CreateTime")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property<int>("TagDefinitionId")
+ .HasColumnType("integer");
+
+ b.Property<int>("TargetObjectId")
+ .HasColumnType("integer");
+
+ b.HasIndex("TagDefinitionId");
+
+ b.HasIndex("TargetObjectId");
+
+ b.ToTable("Tags", (string)null);
+ });
+
+ modelBuilder.Entity("HyperBooru.TagDefinition", b =>
+ {
+ b.HasBaseType("HyperBooru.HBObject");
+
+ b.Property<string>("Alias")
+ .HasColumnType("text");
+
+ b.Property<string>("Name")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property<string>("Namespace")
+ .HasColumnType("text");
+
+ b.Property<int>("Source")
+ .HasColumnType("integer");
+
+ b.ToTable("TagDefinitions", (string)null);
+
+ b.HasData(
+ new
+ {
+ ObjectId = -1,
+ Guid = new Guid("ebdad4f8-455a-4351-8017-1d4854d6fa38"),
+ Name = "nsfw",
+ Source = 0
+ },
+ new
+ {
+ ObjectId = -2,
+ Guid = new Guid("ea212801-5bcc-4c0e-814f-fb9d30db58bc"),
+ Name = "ingest",
+ Source = 0
+ });
+ });
+
+ modelBuilder.Entity("HyperBooru.UploadedFile", b =>
+ {
+ b.HasBaseType("HyperBooru.HBObject");
+
+ b.Property<string>("Checksum")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property<bool>("ChecksumVerified")
+ .HasColumnType("boolean");
+
+ b.Property<DateTime?>("CreateTime")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property<string>("Filename")
+ .HasColumnType("text");
+
+ b.Property<int?>("Height")
+ .HasColumnType("integer");
+
+ b.Property<DateTime?>("LastAccessTime")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property<DateTime?>("LastWriteTime")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property<long>("Length")
+ .HasColumnType("bigint");
+
+ b.Property<int>("MediaObjectId")
+ .HasColumnType("integer");
+
+ b.Property<string>("MimeType")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property<DateTime>("UploadTime")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property<int?>("Width")
+ .HasColumnType("integer");
+
+ b.HasIndex("MediaObjectId");
+
+ 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.HBPrincipal");
+
+ b.Property<string>("PasswordHash")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.ToTable("Users");
+
+ b.HasData(
+ new
+ {
+ ObjectId = -3,
+ Guid = new Guid("bf62bd4c-806e-4d1b-a62d-0efffce8628a"),
+ Name = "admin",
+ PasswordHash = "P4geAuE2yX/PDRHuJSq74FF5vO782rWz5c0LAQPR8m45DEYAONhu1wYnAn60PSNyjocqEBdnCeKCJfK3sKyuWw=="
+ });
+ });
+
+ modelBuilder.Entity("HyperBooru.OcrData", b =>
+ {
+ b.HasOne("HyperBooru.Media", "Media")
+ .WithOne("OcrData")
+ .HasForeignKey("HyperBooru.OcrData", "MediaId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ 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.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")
+ .WithOne()
+ .HasForeignKey("HyperBooru.Media", "CurrentUploadedFileId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("HyperBooru.HBObject", null)
+ .WithOne()
+ .HasForeignKey("HyperBooru.Media", "ObjectId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("CurrentUploadedFile");
+ });
+
+ modelBuilder.Entity("HyperBooru.Tag", b =>
+ {
+ b.HasOne("HyperBooru.HBObject", null)
+ .WithOne()
+ .HasForeignKey("HyperBooru.Tag", "ObjectId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("HyperBooru.TagDefinition", "TagDefinition")
+ .WithMany()
+ .HasForeignKey("TagDefinitionId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("HyperBooru.HBObject", "Target")
+ .WithMany("Tags")
+ .HasForeignKey("TargetObjectId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("TagDefinition");
+
+ b.Navigation("Target");
+ });
+
+ modelBuilder.Entity("HyperBooru.TagDefinition", b =>
+ {
+ b.HasOne("HyperBooru.HBObject", null)
+ .WithOne()
+ .HasForeignKey("HyperBooru.TagDefinition", "ObjectId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("HyperBooru.UploadedFile", b =>
+ {
+ b.HasOne("HyperBooru.Media", "Media")
+ .WithMany("UploadedFiles")
+ .HasForeignKey("MediaObjectId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("HyperBooru.HBObject", null)
+ .WithOne()
+ .HasForeignKey("HyperBooru.UploadedFile", "ObjectId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ 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.HBPrincipal", null)
+ .WithOne()
+ .HasForeignKey("HyperBooru.User", "ObjectId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ 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");
+
+ b.Navigation("UploadedFiles");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/Migrations/20230920014958_Security.cs b/Migrations/20230920014958_Security.cs
new file mode 100644
index 0000000..ed7def8
--- /dev/null
+++ b/Migrations/20230920014958_Security.cs
@@ -0,0 +1,194 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace HyperBooru.Migrations
+{
+ /// <inheritdoc />
+ public partial class Security : Migration
+ {
+ /// <inheritdoc />
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropForeignKey(
+ name: "FK_Users_Objects_ObjectId",
+ table: "Users");
+
+ migrationBuilder.DropIndex(
+ name: "IX_Users_Username",
+ table: "Users");
+
+ migrationBuilder.CreateTable(
+ name: "Acls",
+ columns: table => new
+ {
+ ObjectId = table.Column<int>(type: "integer", nullable: false),
+ SubjectTempId1 = table.Column<int>(type: "integer", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Acls", x => x.ObjectId);
+ table.ForeignKey(
+ name: "FK_Acls_Objects_ObjectId",
+ column: x => x.ObjectId,
+ principalTable: "Objects",
+ principalColumn: "ObjectId",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Principals",
+ columns: table => new
+ {
+ ObjectId = table.Column<int>(type: "integer", nullable: false),
+ Name = table.Column<string>(type: "text", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Principals", x => x.ObjectId);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AclRules",
+ columns: table => new
+ {
+ ObjectId = table.Column<int>(type: "integer", nullable: false),
+ PrincipalObjectId = table.Column<int>(type: "integer", nullable: false),
+ Action = table.Column<int>(type: "integer", nullable: false),
+ Permissions = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
+ AclObjectId = table.Column<int>(type: "integer", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AclRules", x => x.ObjectId);
+ table.ForeignKey(
+ name: "FK_AclRules_Acls_AclObjectId",
+ column: x => x.AclObjectId,
+ principalTable: "Acls",
+ principalColumn: "ObjectId");
+ table.ForeignKey(
+ name: "FK_AclRules_Principals_PrincipalObjectId",
+ column: x => x.PrincipalObjectId,
+ principalTable: "Principals",
+ principalColumn: "ObjectId",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Groups",
+ columns: table => new
+ {
+ ObjectId = table.Column<int>(type: "integer", nullable: false),
+ HBPrincipalObjectId = table.Column<int>(type: "integer", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Groups", x => x.ObjectId);
+ table.ForeignKey(
+ name: "FK_Groups_Principals_HBPrincipalObjectId",
+ column: x => x.HBPrincipalObjectId,
+ principalTable: "Principals",
+ principalColumn: "ObjectId");
+ });
+
+ migrationBuilder.UpdateData(
+ table: "Objects",
+ keyColumn: "ObjectId",
+ keyValue: -3,
+ column: "Guid",
+ value: new Guid("bf62bd4c-806e-4d1b-a62d-0efffce8628a"));
+
+ migrationBuilder.InsertData(
+ table: "Principals",
+ columns: new[] { "ObjectId", "Name" },
+ values: new object[] { -3, "admin" });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AclRules_AclObjectId",
+ table: "AclRules",
+ column: "AclObjectId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AclRules_PrincipalObjectId",
+ table: "AclRules",
+ column: "PrincipalObjectId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Groups_HBPrincipalObjectId",
+ table: "Groups",
+ column: "HBPrincipalObjectId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Principals_Name",
+ table: "Principals",
+ column: "Name");
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_Users_Principals_ObjectId",
+ table: "Users",
+ column: "ObjectId",
+ principalTable: "Principals",
+ principalColumn: "ObjectId",
+ onDelete: ReferentialAction.Cascade);
+
+ migrationBuilder.DropColumn(
+ name: "Username",
+ table: "Users");
+ }
+
+ /// <inheritdoc />
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropForeignKey(
+ name: "FK_Users_Principals_ObjectId",
+ table: "Users");
+
+ migrationBuilder.DropTable(
+ name: "AclRules");
+
+ migrationBuilder.DropTable(
+ name: "Groups");
+
+ migrationBuilder.DropTable(
+ name: "Acls");
+
+ migrationBuilder.DropTable(
+ name: "Principals");
+
+ migrationBuilder.AddColumn<string>(
+ name: "Username",
+ table: "Users",
+ type: "text",
+ nullable: false,
+ defaultValue: "");
+
+ migrationBuilder.UpdateData(
+ table: "Objects",
+ keyColumn: "ObjectId",
+ keyValue: -3,
+ column: "Guid",
+ value: new Guid("4fa948f4-7c45-4f81-bb6b-e417491e6c96"));
+
+ migrationBuilder.UpdateData(
+ table: "Users",
+ keyColumn: "ObjectId",
+ keyValue: -3,
+ column: "Username",
+ value: "admin");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Users_Username",
+ table: "Users",
+ column: "Username");
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_Users_Objects_ObjectId",
+ table: "Users",
+ column: "ObjectId",
+ principalTable: "Objects",
+ principalColumn: "ObjectId",
+ onDelete: ReferentialAction.Cascade);
+ }
+ }
+}
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");