summaryrefslogtreecommitdiff
path: root/Migrations
diff options
context:
space:
mode:
Diffstat (limited to 'Migrations')
-rw-r--r--Migrations/20231001212740_Security.Designer.cs492
-rw-r--r--Migrations/20231001212740_Security.cs312
-rw-r--r--Migrations/20231009045945_SecurityRevision.Designer.cs497
-rw-r--r--Migrations/20231009045945_SecurityRevision.cs63
-rw-r--r--Migrations/20231020031326_NullableCurrentUploadedFile.Designer.cs490
-rw-r--r--Migrations/20231020031326_NullableCurrentUploadedFile.cs97
-rw-r--r--Migrations/HBContextModelSnapshot.cs174
7 files changed, 20 insertions, 2105 deletions
diff --git a/Migrations/20231001212740_Security.Designer.cs b/Migrations/20231001212740_Security.Designer.cs
deleted file mode 100644
index 0b3c8ee..0000000
--- a/Migrations/20231001212740_Security.Designer.cs
+++ /dev/null
@@ -1,492 +0,0 @@
-// <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("20231001212740_Security")]
- partial class Security
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .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")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- 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);
-
- 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")
- .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("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")
- .HasColumnType("integer");
-
- b.Property<int>("TagDefinitionObjectId")
- .HasColumnType("integer");
-
- b.HasKey("ImplicitTagsObjectId", "TagDefinitionObjectId");
-
- b.HasIndex("TagDefinitionObjectId");
-
- b.ToTable("ImplicitTags", (string)null);
- });
-
- 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"),
- Owner = new byte[] { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
- Name = "nsfw",
- Source = 0
- },
- new
- {
- 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
- });
- });
-
- 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.LocalGroup", b =>
- {
- b.HasBaseType("HyperBooru.LocalPrincipal");
-
- b.HasDiscriminator().HasValue("LocalGroup");
- });
-
- modelBuilder.Entity("HyperBooru.LocalUser", b =>
- {
- b.HasBaseType("HyperBooru.LocalPrincipal");
-
- b.Property<string>("PasswordHash")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasDiscriminator().HasValue("LocalUser");
-
- b.HasData(
- new
- {
- 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")
- .WithOne("OcrData")
- .HasForeignKey("HyperBooru.OcrData", "MediaId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- 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)
- .WithMany()
- .HasForeignKey("ImplicitTagsObjectId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("HyperBooru.TagDefinition", null)
- .WithMany()
- .HasForeignKey("TagDefinitionObjectId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- 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.Acl", b =>
- {
- b.Navigation("Rules");
-
- b.Navigation("Subject")
- .IsRequired();
- });
-
- modelBuilder.Entity("HyperBooru.HBObject", b =>
- {
- b.Navigation("Tags");
- });
-
- modelBuilder.Entity("HyperBooru.Media", b =>
- {
- b.Navigation("OcrData");
-
- b.Navigation("UploadedFiles");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/Migrations/20231001212740_Security.cs b/Migrations/20231001212740_Security.cs
deleted file mode 100644
index 0e38fde..0000000
--- a/Migrations/20231001212740_Security.cs
+++ /dev/null
@@ -1,312 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
-#nullable disable
-
-namespace HyperBooru.Migrations
-{
- /// <inheritdoc />
- public partial class Security : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_TagDefinitionTagDefinition_TagDefinitions_ImplicitTagsObjec~",
- table: "TagDefinitionTagDefinition");
-
- migrationBuilder.DropForeignKey(
- name: "FK_TagDefinitionTagDefinition_TagDefinitions_TagDefinitionObje~",
- table: "TagDefinitionTagDefinition");
-
- migrationBuilder.DropTable(
- name: "Users");
-
- migrationBuilder.DropPrimaryKey(
- name: "PK_TagDefinitionTagDefinition",
- table: "TagDefinitionTagDefinition");
-
- migrationBuilder.DeleteData(
- table: "Objects",
- keyColumn: "ObjectId",
- keyValue: -3);
-
- migrationBuilder.RenameTable(
- name: "TagDefinitionTagDefinition",
- newName: "ImplicitTags");
-
- migrationBuilder.RenameIndex(
- name: "IX_TagDefinitionTagDefinition_TagDefinitionObjectId",
- table: "ImplicitTags",
- newName: "IX_ImplicitTags_TagDefinitionObjectId");
-
- migrationBuilder.AddColumn<int>(
- name: "AclId",
- table: "Objects",
- type: "integer",
- nullable: true);
-
- migrationBuilder.AddColumn<byte[]>(
- name: "Owner",
- table: "Objects",
- type: "bytea",
- nullable: false,
- defaultValue: new byte[] { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 });
-
- migrationBuilder.AddPrimaryKey(
- name: "PK_ImplicitTags",
- table: "ImplicitTags",
- columns: new[] { "ImplicitTagsObjectId", "TagDefinitionObjectId" });
-
- migrationBuilder.CreateTable(
- name: "Acls",
- columns: table => new
- {
- AclId = table.Column<int>(type: "integer", nullable: false)
- .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Acls", x => x.AclId);
- });
-
- migrationBuilder.CreateTable(
- name: "SecurityPrincipals",
- columns: table => new
- {
- LocalPrincipalId = table.Column<int>(type: "integer", nullable: false)
- .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
- Name = table.Column<string>(type: "text", nullable: false),
- Sid = table.Column<byte[]>(type: "bytea", nullable: false),
- Discriminator = table.Column<string>(type: "text", nullable: false),
- PasswordHash = table.Column<string>(type: "text", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_SecurityPrincipals", x => x.LocalPrincipalId);
- });
-
- migrationBuilder.CreateTable(
- name: "AclRules",
- columns: table => new
- {
- AclRuleId = table.Column<int>(type: "integer", nullable: false)
- .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
- Principal = table.Column<byte[]>(type: "bytea", nullable: false),
- Action = table.Column<int>(type: "integer", nullable: false),
- Permissions = table.Column<long>(type: "bigint", nullable: false),
- AclId = table.Column<int>(type: "integer", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AclRules", x => x.AclRuleId);
- table.ForeignKey(
- name: "FK_AclRules_Acls_AclId",
- column: x => x.AclId,
- principalTable: "Acls",
- principalColumn: "AclId");
- });
-
- migrationBuilder.CreateTable(
- name: "SecurityPrincipalMemberships",
- columns: table => new
- {
- LocalPrincipalId = table.Column<int>(type: "integer", nullable: false),
- MemberOfLocalPrincipalId = table.Column<int>(type: "integer", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_SecurityPrincipalMemberships", x => new { x.LocalPrincipalId, x.MemberOfLocalPrincipalId });
- table.ForeignKey(
- name: "FK_SecurityPrincipalMemberships_SecurityPrincipals_LocalPrinci~",
- column: x => x.LocalPrincipalId,
- principalTable: "SecurityPrincipals",
- principalColumn: "LocalPrincipalId",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_SecurityPrincipalMemberships_SecurityPrincipals_MemberOfLoc~",
- column: x => x.MemberOfLocalPrincipalId,
- principalTable: "SecurityPrincipals",
- principalColumn: "LocalPrincipalId",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.UpdateData(
- table: "Objects",
- keyColumn: "ObjectId",
- keyValue: -2,
- columns: new[] { "AclId", "Owner" },
- values: new object[] { null, new byte[] { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 } });
-
- migrationBuilder.UpdateData(
- table: "Objects",
- keyColumn: "ObjectId",
- keyValue: -1,
- columns: new[] { "AclId", "Owner" },
- values: new object[] { null, new byte[] { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 } });
-
- migrationBuilder.InsertData(
- table: "SecurityPrincipals",
- columns: new[] { "LocalPrincipalId", "Discriminator", "Name", "PasswordHash", "Sid" },
- values: new object[] { -1, "LocalUser", "admin", "P4geAuE2yX/PDRHuJSq74FF5vO782rWz5c0LAQPR8m45DEYAONhu1wYnAn60PSNyjocqEBdnCeKCJfK3sKyuWw==", new byte[] { 1, 1, 0, 0, 0, 0, 0, 5, 18, 0, 0, 0 } });
-
- migrationBuilder.CreateIndex(
- name: "IX_Objects_AclId",
- table: "Objects",
- column: "AclId",
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_AclRules_AclId",
- table: "AclRules",
- column: "AclId");
-
- migrationBuilder.CreateIndex(
- name: "IX_SecurityPrincipalMemberships_MemberOfLocalPrincipalId",
- table: "SecurityPrincipalMemberships",
- column: "MemberOfLocalPrincipalId");
-
- migrationBuilder.CreateIndex(
- name: "IX_SecurityPrincipals_Name",
- table: "SecurityPrincipals",
- column: "Name");
-
- migrationBuilder.CreateIndex(
- name: "IX_SecurityPrincipals_Sid",
- table: "SecurityPrincipals",
- column: "Sid");
-
- migrationBuilder.AddForeignKey(
- name: "FK_ImplicitTags_TagDefinitions_ImplicitTagsObjectId",
- table: "ImplicitTags",
- column: "ImplicitTagsObjectId",
- principalTable: "TagDefinitions",
- principalColumn: "ObjectId",
- onDelete: ReferentialAction.Cascade);
-
- migrationBuilder.AddForeignKey(
- name: "FK_ImplicitTags_TagDefinitions_TagDefinitionObjectId",
- table: "ImplicitTags",
- column: "TagDefinitionObjectId",
- principalTable: "TagDefinitions",
- principalColumn: "ObjectId",
- onDelete: ReferentialAction.Cascade);
-
- migrationBuilder.AddForeignKey(
- name: "FK_Objects_Acls_AclId",
- table: "Objects",
- column: "AclId",
- principalTable: "Acls",
- principalColumn: "AclId");
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_ImplicitTags_TagDefinitions_ImplicitTagsObjectId",
- table: "ImplicitTags");
-
- migrationBuilder.DropForeignKey(
- name: "FK_ImplicitTags_TagDefinitions_TagDefinitionObjectId",
- table: "ImplicitTags");
-
- migrationBuilder.DropForeignKey(
- name: "FK_Objects_Acls_AclId",
- table: "Objects");
-
- migrationBuilder.DropTable(
- name: "AclRules");
-
- migrationBuilder.DropTable(
- name: "SecurityPrincipalMemberships");
-
- migrationBuilder.DropTable(
- name: "Acls");
-
- migrationBuilder.DropTable(
- name: "SecurityPrincipals");
-
- migrationBuilder.DropIndex(
- name: "IX_Objects_AclId",
- table: "Objects");
-
- migrationBuilder.DropPrimaryKey(
- name: "PK_ImplicitTags",
- table: "ImplicitTags");
-
- migrationBuilder.DropColumn(
- name: "AclId",
- table: "Objects");
-
- migrationBuilder.DropColumn(
- name: "Owner",
- table: "Objects");
-
- migrationBuilder.RenameTable(
- name: "ImplicitTags",
- newName: "TagDefinitionTagDefinition");
-
- migrationBuilder.RenameIndex(
- name: "IX_ImplicitTags_TagDefinitionObjectId",
- table: "TagDefinitionTagDefinition",
- newName: "IX_TagDefinitionTagDefinition_TagDefinitionObjectId");
-
- migrationBuilder.AddPrimaryKey(
- name: "PK_TagDefinitionTagDefinition",
- table: "TagDefinitionTagDefinition",
- columns: new[] { "ImplicitTagsObjectId", "TagDefinitionObjectId" });
-
- migrationBuilder.CreateTable(
- name: "Users",
- columns: table => new
- {
- ObjectId = table.Column<int>(type: "integer", nullable: false),
- PasswordHash = table.Column<string>(type: "text", nullable: false),
- Username = table.Column<string>(type: "text", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Users", x => x.ObjectId);
- table.ForeignKey(
- name: "FK_Users_Objects_ObjectId",
- column: x => x.ObjectId,
- principalTable: "Objects",
- principalColumn: "ObjectId",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.InsertData(
- table: "Objects",
- columns: new[] { "ObjectId", "Guid" },
- values: new object[] { -3, new Guid("4fa948f4-7c45-4f81-bb6b-e417491e6c96") });
-
- migrationBuilder.InsertData(
- table: "Users",
- columns: new[] { "ObjectId", "PasswordHash", "Username" },
- values: new object[] { -3, "P4geAuE2yX/PDRHuJSq74FF5vO782rWz5c0LAQPR8m45DEYAONhu1wYnAn60PSNyjocqEBdnCeKCJfK3sKyuWw==", "admin" });
-
- migrationBuilder.CreateIndex(
- name: "IX_Users_Username",
- table: "Users",
- column: "Username");
-
- migrationBuilder.AddForeignKey(
- name: "FK_TagDefinitionTagDefinition_TagDefinitions_ImplicitTagsObjec~",
- table: "TagDefinitionTagDefinition",
- column: "ImplicitTagsObjectId",
- principalTable: "TagDefinitions",
- principalColumn: "ObjectId",
- onDelete: ReferentialAction.Cascade);
-
- migrationBuilder.AddForeignKey(
- name: "FK_TagDefinitionTagDefinition_TagDefinitions_TagDefinitionObje~",
- table: "TagDefinitionTagDefinition",
- column: "TagDefinitionObjectId",
- principalTable: "TagDefinitions",
- principalColumn: "ObjectId",
- onDelete: ReferentialAction.Cascade);
- }
- }
-}
diff --git a/Migrations/20231009045945_SecurityRevision.Designer.cs b/Migrations/20231009045945_SecurityRevision.Designer.cs
deleted file mode 100644
index a2c924d..0000000
--- a/Migrations/20231009045945_SecurityRevision.Designer.cs
+++ /dev/null
@@ -1,497 +0,0 @@
-// <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("20231009045945_SecurityRevision")]
- partial class SecurityRevision
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .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")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- 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);
-
- 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>("DisplayName")
- .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")
- .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("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")
- .HasColumnType("integer");
-
- b.Property<int>("TagDefinitionObjectId")
- .HasColumnType("integer");
-
- b.HasKey("ImplicitTagsObjectId", "TagDefinitionObjectId");
-
- b.HasIndex("TagDefinitionObjectId");
-
- b.ToTable("ImplicitTags", (string)null);
- });
-
- 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"),
- Owner = new byte[] { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
- Name = "nsfw",
- Source = 0
- },
- new
- {
- 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
- });
- });
-
- 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.LocalGroup", b =>
- {
- b.HasBaseType("HyperBooru.LocalPrincipal");
-
- b.HasDiscriminator().HasValue("LocalGroup");
- });
-
- modelBuilder.Entity("HyperBooru.LocalUser", b =>
- {
- b.HasBaseType("HyperBooru.LocalPrincipal");
-
- b.Property<string>("PasswordHash")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasDiscriminator().HasValue("LocalUser");
-
- b.HasData(
- new
- {
- LocalPrincipalId = -1,
- DisplayName = "Administrator",
- Name = "Administrator",
- 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")
- .WithOne("OcrData")
- .HasForeignKey("HyperBooru.OcrData", "MediaId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- 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)
- .WithMany()
- .HasForeignKey("ImplicitTagsObjectId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("HyperBooru.TagDefinition", null)
- .WithMany()
- .HasForeignKey("TagDefinitionObjectId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- 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.Acl", b =>
- {
- b.Navigation("Rules");
-
- b.Navigation("Subject")
- .IsRequired();
- });
-
- modelBuilder.Entity("HyperBooru.HBObject", b =>
- {
- b.Navigation("Tags");
- });
-
- modelBuilder.Entity("HyperBooru.Media", b =>
- {
- b.Navigation("OcrData");
-
- b.Navigation("UploadedFiles");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/Migrations/20231009045945_SecurityRevision.cs b/Migrations/20231009045945_SecurityRevision.cs
deleted file mode 100644
index 03fbd60..0000000
--- a/Migrations/20231009045945_SecurityRevision.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace HyperBooru.Migrations
-{
- /// <inheritdoc />
- public partial class SecurityRevision : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<string>(
- name: "DisplayName",
- table: "SecurityPrincipals",
- type: "text",
- nullable: false,
- defaultValue: "");
-
- migrationBuilder.AlterColumn<byte[]>(
- name: "Owner",
- table: "Objects",
- type: "bytea",
- nullable: false,
- defaultValue: new byte[] { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
- oldClrType: typeof(byte[]),
- oldType: "bytea",
- oldDefaultValue: new byte[] { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 });
-
- migrationBuilder.UpdateData(
- table: "SecurityPrincipals",
- keyColumn: "LocalPrincipalId",
- keyValue: -1,
- columns: new[] { "DisplayName", "Name" },
- values: new object[] { "Administrator", "Administrator" });
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "DisplayName",
- table: "SecurityPrincipals");
-
- migrationBuilder.AlterColumn<byte[]>(
- name: "Owner",
- table: "Objects",
- type: "bytea",
- nullable: false,
- defaultValue: new byte[] { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
- oldClrType: typeof(byte[]),
- oldType: "bytea",
- oldDefaultValue: new byte[] { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 });
-
- migrationBuilder.UpdateData(
- table: "SecurityPrincipals",
- keyColumn: "LocalPrincipalId",
- keyValue: -1,
- column: "Name",
- value: "admin");
- }
- }
-}
diff --git a/Migrations/20231020031326_NullableCurrentUploadedFile.Designer.cs b/Migrations/20231020031326_NullableCurrentUploadedFile.Designer.cs
deleted file mode 100644
index 89f933c..0000000
--- a/Migrations/20231020031326_NullableCurrentUploadedFile.Designer.cs
+++ /dev/null
@@ -1,490 +0,0 @@
-// <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("20231020031326_NullableCurrentUploadedFile")]
- partial class NullableCurrentUploadedFile
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .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<byte[]>("Principal")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.HasKey("AclRuleId");
-
- b.HasIndex("AclId");
-
- b.ToTable("AclRules");
- });
-
- modelBuilder.Entity("HyperBooru.HBObject", b =>
- {
- b.Property<int>("ObjectId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- 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);
-
- 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")
- .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("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")
- .HasColumnType("integer");
-
- b.Property<int>("TagDefinitionObjectId")
- .HasColumnType("integer");
-
- b.HasKey("ImplicitTagsObjectId", "TagDefinitionObjectId");
-
- b.HasIndex("TagDefinitionObjectId");
-
- b.ToTable("ImplicitTags", (string)null);
- });
-
- 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"),
- Owner = new byte[] { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
- Name = "nsfw",
- Source = 0
- },
- new
- {
- 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
- });
- });
-
- 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.LocalGroup", b =>
- {
- b.HasBaseType("HyperBooru.LocalPrincipal");
-
- b.HasDiscriminator().HasValue("LocalGroup");
- });
-
- modelBuilder.Entity("HyperBooru.LocalUser", b =>
- {
- b.HasBaseType("HyperBooru.LocalPrincipal");
-
- b.Property<string>("PasswordHash")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasDiscriminator().HasValue("LocalUser");
-
- 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=="
- });
- });
-
- 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")
- .WithOne("OcrData")
- .HasForeignKey("HyperBooru.OcrData", "MediaId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- 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)
- .WithMany()
- .HasForeignKey("ImplicitTagsObjectId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("HyperBooru.TagDefinition", null)
- .WithMany()
- .HasForeignKey("TagDefinitionObjectId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("HyperBooru.Media", b =>
- {
- b.HasOne("HyperBooru.UploadedFile", "CurrentUploadedFile")
- .WithOne()
- .HasForeignKey("HyperBooru.Media", "CurrentUploadedFileId");
-
- 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.Acl", b =>
- {
- b.Navigation("Rules");
-
- b.Navigation("Subject")
- .IsRequired();
- });
-
- modelBuilder.Entity("HyperBooru.HBObject", b =>
- {
- b.Navigation("Tags");
- });
-
- modelBuilder.Entity("HyperBooru.Media", b =>
- {
- b.Navigation("OcrData");
-
- b.Navigation("UploadedFiles");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/Migrations/20231020031326_NullableCurrentUploadedFile.cs b/Migrations/20231020031326_NullableCurrentUploadedFile.cs
deleted file mode 100644
index 5159d16..0000000
--- a/Migrations/20231020031326_NullableCurrentUploadedFile.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace HyperBooru.Migrations
-{
- /// <inheritdoc />
- public partial class NullableCurrentUploadedFile : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_Media_UploadedFiles_CurrentUploadedFileId",
- table: "Media");
-
- migrationBuilder.DropColumn(
- name: "DisplayName",
- table: "SecurityPrincipals");
-
- migrationBuilder.AlterColumn<byte[]>(
- name: "Owner",
- table: "Objects",
- type: "bytea",
- nullable: false,
- defaultValue: new byte[] { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
- oldClrType: typeof(byte[]),
- oldType: "bytea",
- oldDefaultValue: new byte[] { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 });
-
- migrationBuilder.AlterColumn<int>(
- name: "CurrentUploadedFileId",
- table: "Media",
- type: "integer",
- nullable: true,
- oldClrType: typeof(int),
- oldType: "integer");
-
- migrationBuilder.AddForeignKey(
- name: "FK_Media_UploadedFiles_CurrentUploadedFileId",
- table: "Media",
- column: "CurrentUploadedFileId",
- principalTable: "UploadedFiles",
- principalColumn: "ObjectId");
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_Media_UploadedFiles_CurrentUploadedFileId",
- table: "Media");
-
- migrationBuilder.AddColumn<string>(
- name: "DisplayName",
- table: "SecurityPrincipals",
- type: "text",
- nullable: false,
- defaultValue: "");
-
- migrationBuilder.AlterColumn<byte[]>(
- name: "Owner",
- table: "Objects",
- type: "bytea",
- nullable: false,
- defaultValue: new byte[] { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
- oldClrType: typeof(byte[]),
- oldType: "bytea",
- oldDefaultValue: new byte[] { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 });
-
- migrationBuilder.AlterColumn<int>(
- name: "CurrentUploadedFileId",
- table: "Media",
- type: "integer",
- nullable: false,
- defaultValue: 0,
- oldClrType: typeof(int),
- oldType: "integer",
- oldNullable: true);
-
- migrationBuilder.UpdateData(
- table: "SecurityPrincipals",
- keyColumn: "LocalPrincipalId",
- keyValue: -1,
- column: "DisplayName",
- value: "Administrator");
-
- migrationBuilder.AddForeignKey(
- name: "FK_Media_UploadedFiles_CurrentUploadedFileId",
- table: "Media",
- column: "CurrentUploadedFileId",
- principalTable: "UploadedFiles",
- principalColumn: "ObjectId",
- onDelete: ReferentialAction.Cascade);
- }
- }
-}
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<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")
@@ -71,23 +30,11 @@ 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);
@@ -95,39 +42,6 @@ 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")
@@ -158,21 +72,6 @@ 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")
@@ -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<string>("PasswordHash")
.IsRequired()
.HasColumnType("text");
- b.HasDiscriminator().HasValue("LocalUser");
+ b.Property<string>("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();
});