summaryrefslogtreecommitdiff
path: root/Migrations
diff options
context:
space:
mode:
authorJake Mannens <jake@asger.xyz>2023-08-15 15:49:14 +1000
committerJake Mannens <jake@asger.xyz>2023-08-15 15:49:14 +1000
commit8e94a12be4a56447e78d68c37def772bef8cade4 (patch)
tree0a12c64f8e34da45df8ac8e4c484c83385aedb45 /Migrations
parent5b00f23b28e3a09a4120101a8be8802d009e5d84 (diff)
Convert Razor pages to Blazor
Diffstat (limited to 'Migrations')
-rw-r--r--Migrations/20230814013743_Initial.Designer.cs (renamed from Migrations/20230812095148_Initial.Designer.cs)77
-rw-r--r--Migrations/20230814013743_Initial.cs (renamed from Migrations/20230812095148_Initial.cs)25
-rw-r--r--Migrations/HBContextModelSnapshot.cs (renamed from Migrations/HyperBooruDbContextModelSnapshot.cs)77
3 files changed, 84 insertions, 95 deletions
diff --git a/Migrations/20230812095148_Initial.Designer.cs b/Migrations/20230814013743_Initial.Designer.cs
index 277e607..c221c85 100644
--- a/Migrations/20230812095148_Initial.Designer.cs
+++ b/Migrations/20230814013743_Initial.Designer.cs
@@ -10,8 +10,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace HyperBooru.Migrations
{
- [DbContext(typeof(HyperBooruDbContext))]
- [Migration("20230812095148_Initial")]
+ [DbContext(typeof(HBContext))]
+ [Migration("20230814013743_Initial")]
partial class Initial
{
/// <inheritdoc />
@@ -24,7 +24,7 @@ namespace HyperBooru.Migrations
.HasAnnotation("Proxies:CheckEquality", false)
.HasAnnotation("Proxies:LazyLoading", true);
- modelBuilder.Entity("HyperBooru.DbObject", b =>
+ modelBuilder.Entity("HyperBooru.HBObject", b =>
{
b.Property<int>("ObjectId")
.ValueGeneratedOnAdd()
@@ -33,9 +33,6 @@ namespace HyperBooru.Migrations
b.Property<Guid>("Guid")
.HasColumnType("TEXT");
- b.Property<int>("ObjectType")
- .HasColumnType("INTEGER");
-
b.HasKey("ObjectId");
b.HasIndex("Guid");
@@ -45,7 +42,7 @@ namespace HyperBooru.Migrations
b.UseTptMappingStrategy();
});
- modelBuilder.Entity("HyperBooru.DbUploadedFile", b =>
+ modelBuilder.Entity("HyperBooru.UploadedFile", b =>
{
b.Property<int>("UploadedFileId")
.ValueGeneratedOnAdd()
@@ -80,9 +77,9 @@ namespace HyperBooru.Migrations
b.ToTable("UploadedFiles", (string)null);
});
- modelBuilder.Entity("HyperBooru.DbMedia", b =>
+ modelBuilder.Entity("HyperBooru.Media", b =>
{
- b.HasBaseType("HyperBooru.DbObject");
+ b.HasBaseType("HyperBooru.HBObject");
b.Property<string>("Checksum")
.IsRequired()
@@ -101,9 +98,9 @@ namespace HyperBooru.Migrations
b.ToTable("Media", (string)null);
});
- modelBuilder.Entity("HyperBooru.DbTag", b =>
+ modelBuilder.Entity("HyperBooru.Tag", b =>
{
- b.HasBaseType("HyperBooru.DbObject");
+ b.HasBaseType("HyperBooru.HBObject");
b.Property<DateTime>("CreateTime")
.HasColumnType("TEXT");
@@ -121,12 +118,9 @@ namespace HyperBooru.Migrations
b.ToTable("Tags", (string)null);
});
- modelBuilder.Entity("HyperBooru.DbTagDefinition", b =>
+ modelBuilder.Entity("HyperBooru.TagDefinition", b =>
{
- b.HasBaseType("HyperBooru.DbObject");
-
- b.Property<int?>("DbTagDefinitionObjectId")
- .HasColumnType("INTEGER");
+ b.HasBaseType("HyperBooru.HBObject");
b.Property<string>("Name")
.IsRequired()
@@ -138,7 +132,10 @@ namespace HyperBooru.Migrations
b.Property<int>("Source")
.HasColumnType("INTEGER");
- b.HasIndex("DbTagDefinitionObjectId");
+ b.Property<int?>("TagDefinitionObjectId")
+ .HasColumnType("INTEGER");
+
+ b.HasIndex("TagDefinitionObjectId");
b.ToTable("TagDefinitions", (string)null);
@@ -146,24 +143,22 @@ namespace HyperBooru.Migrations
new
{
ObjectId = -1,
- Guid = new Guid("a03e1649-bd30-4db1-a81d-be05ba05f357"),
- ObjectType = 0,
+ Guid = new Guid("cbd871cb-8790-4519-9f74-90d1e13a48a0"),
Name = "nsfw",
Source = 0
},
new
{
ObjectId = -2,
- Guid = new Guid("3094fe00-8e41-4c08-8828-dea2ba878dd4"),
- ObjectType = 0,
+ Guid = new Guid("716ac11f-135a-433c-84a7-7bdfddbec004"),
Name = "ingest",
Source = 0
});
});
- modelBuilder.Entity("HyperBooru.DbUploadedFile", b =>
+ modelBuilder.Entity("HyperBooru.UploadedFile", b =>
{
- b.HasOne("HyperBooru.DbMedia", "Media")
+ b.HasOne("HyperBooru.Media", "Media")
.WithMany("UploadedFiles")
.HasForeignKey("MediaObjectId")
.OnDelete(DeleteBehavior.Cascade)
@@ -172,30 +167,30 @@ namespace HyperBooru.Migrations
b.Navigation("Media");
});
- modelBuilder.Entity("HyperBooru.DbMedia", b =>
+ modelBuilder.Entity("HyperBooru.Media", b =>
{
- b.HasOne("HyperBooru.DbObject", null)
+ b.HasOne("HyperBooru.HBObject", null)
.WithOne()
- .HasForeignKey("HyperBooru.DbMedia", "ObjectId")
+ .HasForeignKey("HyperBooru.Media", "ObjectId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
- modelBuilder.Entity("HyperBooru.DbTag", b =>
+ modelBuilder.Entity("HyperBooru.Tag", b =>
{
- b.HasOne("HyperBooru.DbObject", null)
+ b.HasOne("HyperBooru.HBObject", null)
.WithOne()
- .HasForeignKey("HyperBooru.DbTag", "ObjectId")
+ .HasForeignKey("HyperBooru.Tag", "ObjectId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
- b.HasOne("HyperBooru.DbTagDefinition", "TagDefinition")
+ b.HasOne("HyperBooru.TagDefinition", "TagDefinition")
.WithMany()
.HasForeignKey("TagDefinitionObjectId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
- b.HasOne("HyperBooru.DbObject", "Target")
+ b.HasOne("HyperBooru.HBObject", "Target")
.WithMany("Tags")
.HasForeignKey("TargetObjectId")
.OnDelete(DeleteBehavior.Cascade)
@@ -206,30 +201,30 @@ namespace HyperBooru.Migrations
b.Navigation("Target");
});
- modelBuilder.Entity("HyperBooru.DbTagDefinition", b =>
+ modelBuilder.Entity("HyperBooru.TagDefinition", b =>
{
- b.HasOne("HyperBooru.DbTagDefinition", null)
- .WithMany("ImplicitTags")
- .HasForeignKey("DbTagDefinitionObjectId");
-
- b.HasOne("HyperBooru.DbObject", null)
+ b.HasOne("HyperBooru.HBObject", null)
.WithOne()
- .HasForeignKey("HyperBooru.DbTagDefinition", "ObjectId")
+ .HasForeignKey("HyperBooru.TagDefinition", "ObjectId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
+
+ b.HasOne("HyperBooru.TagDefinition", null)
+ .WithMany("ImplicitTags")
+ .HasForeignKey("TagDefinitionObjectId");
});
- modelBuilder.Entity("HyperBooru.DbObject", b =>
+ modelBuilder.Entity("HyperBooru.HBObject", b =>
{
b.Navigation("Tags");
});
- modelBuilder.Entity("HyperBooru.DbMedia", b =>
+ modelBuilder.Entity("HyperBooru.Media", b =>
{
b.Navigation("UploadedFiles");
});
- modelBuilder.Entity("HyperBooru.DbTagDefinition", b =>
+ modelBuilder.Entity("HyperBooru.TagDefinition", b =>
{
b.Navigation("ImplicitTags");
});
diff --git a/Migrations/20230812095148_Initial.cs b/Migrations/20230814013743_Initial.cs
index 40150bd..1390c18 100644
--- a/Migrations/20230812095148_Initial.cs
+++ b/Migrations/20230814013743_Initial.cs
@@ -19,8 +19,7 @@ namespace HyperBooru.Migrations
{
ObjectId = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
- Guid = table.Column<Guid>(type: "TEXT", nullable: false),
- ObjectType = table.Column<int>(type: "INTEGER", nullable: false)
+ Guid = table.Column<Guid>(type: "TEXT", nullable: false)
},
constraints: table =>
{
@@ -58,7 +57,7 @@ namespace HyperBooru.Migrations
Source = table.Column<int>(type: "INTEGER", nullable: false),
Namespace = table.Column<string>(type: "TEXT", nullable: true),
Name = table.Column<string>(type: "TEXT", nullable: false),
- DbTagDefinitionObjectId = table.Column<int>(type: "INTEGER", nullable: true)
+ TagDefinitionObjectId = table.Column<int>(type: "INTEGER", nullable: true)
},
constraints: table =>
{
@@ -70,8 +69,8 @@ namespace HyperBooru.Migrations
principalColumn: "ObjectId",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
- name: "FK_TagDefinitions_TagDefinitions_DbTagDefinitionObjectId",
- column: x => x.DbTagDefinitionObjectId,
+ name: "FK_TagDefinitions_TagDefinitions_TagDefinitionObjectId",
+ column: x => x.TagDefinitionObjectId,
principalTable: "TagDefinitions",
principalColumn: "ObjectId");
});
@@ -136,20 +135,20 @@ namespace HyperBooru.Migrations
migrationBuilder.InsertData(
table: "Objects",
- columns: new[] { "ObjectId", "Guid", "ObjectType" },
+ columns: new[] { "ObjectId", "Guid" },
values: new object[,]
{
- { -2, new Guid("3094fe00-8e41-4c08-8828-dea2ba878dd4"), 0 },
- { -1, new Guid("a03e1649-bd30-4db1-a81d-be05ba05f357"), 0 }
+ { -2, new Guid("716ac11f-135a-433c-84a7-7bdfddbec004") },
+ { -1, new Guid("cbd871cb-8790-4519-9f74-90d1e13a48a0") }
});
migrationBuilder.InsertData(
table: "TagDefinitions",
- columns: new[] { "ObjectId", "DbTagDefinitionObjectId", "Name", "Namespace", "Source" },
+ columns: new[] { "ObjectId", "Name", "Namespace", "Source", "TagDefinitionObjectId" },
values: new object[,]
{
- { -2, null, "ingest", null, 0 },
- { -1, null, "nsfw", null, 0 }
+ { -2, "ingest", null, 0, null },
+ { -1, "nsfw", null, 0, null }
});
migrationBuilder.CreateIndex(
@@ -158,9 +157,9 @@ namespace HyperBooru.Migrations
column: "Guid");
migrationBuilder.CreateIndex(
- name: "IX_TagDefinitions_DbTagDefinitionObjectId",
+ name: "IX_TagDefinitions_TagDefinitionObjectId",
table: "TagDefinitions",
- column: "DbTagDefinitionObjectId");
+ column: "TagDefinitionObjectId");
migrationBuilder.CreateIndex(
name: "IX_Tags_TagDefinitionObjectId",
diff --git a/Migrations/HyperBooruDbContextModelSnapshot.cs b/Migrations/HBContextModelSnapshot.cs
index 7096799..9697e16 100644
--- a/Migrations/HyperBooruDbContextModelSnapshot.cs
+++ b/Migrations/HBContextModelSnapshot.cs
@@ -9,8 +9,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace HyperBooru.Migrations
{
- [DbContext(typeof(HyperBooruDbContext))]
- partial class HyperBooruDbContextModelSnapshot : ModelSnapshot
+ [DbContext(typeof(HBContext))]
+ partial class HBContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
@@ -21,7 +21,7 @@ namespace HyperBooru.Migrations
.HasAnnotation("Proxies:CheckEquality", false)
.HasAnnotation("Proxies:LazyLoading", true);
- modelBuilder.Entity("HyperBooru.DbObject", b =>
+ modelBuilder.Entity("HyperBooru.HBObject", b =>
{
b.Property<int>("ObjectId")
.ValueGeneratedOnAdd()
@@ -30,9 +30,6 @@ namespace HyperBooru.Migrations
b.Property<Guid>("Guid")
.HasColumnType("TEXT");
- b.Property<int>("ObjectType")
- .HasColumnType("INTEGER");
-
b.HasKey("ObjectId");
b.HasIndex("Guid");
@@ -42,7 +39,7 @@ namespace HyperBooru.Migrations
b.UseTptMappingStrategy();
});
- modelBuilder.Entity("HyperBooru.DbUploadedFile", b =>
+ modelBuilder.Entity("HyperBooru.UploadedFile", b =>
{
b.Property<int>("UploadedFileId")
.ValueGeneratedOnAdd()
@@ -77,9 +74,9 @@ namespace HyperBooru.Migrations
b.ToTable("UploadedFiles", (string)null);
});
- modelBuilder.Entity("HyperBooru.DbMedia", b =>
+ modelBuilder.Entity("HyperBooru.Media", b =>
{
- b.HasBaseType("HyperBooru.DbObject");
+ b.HasBaseType("HyperBooru.HBObject");
b.Property<string>("Checksum")
.IsRequired()
@@ -98,9 +95,9 @@ namespace HyperBooru.Migrations
b.ToTable("Media", (string)null);
});
- modelBuilder.Entity("HyperBooru.DbTag", b =>
+ modelBuilder.Entity("HyperBooru.Tag", b =>
{
- b.HasBaseType("HyperBooru.DbObject");
+ b.HasBaseType("HyperBooru.HBObject");
b.Property<DateTime>("CreateTime")
.HasColumnType("TEXT");
@@ -118,12 +115,9 @@ namespace HyperBooru.Migrations
b.ToTable("Tags", (string)null);
});
- modelBuilder.Entity("HyperBooru.DbTagDefinition", b =>
+ modelBuilder.Entity("HyperBooru.TagDefinition", b =>
{
- b.HasBaseType("HyperBooru.DbObject");
-
- b.Property<int?>("DbTagDefinitionObjectId")
- .HasColumnType("INTEGER");
+ b.HasBaseType("HyperBooru.HBObject");
b.Property<string>("Name")
.IsRequired()
@@ -135,7 +129,10 @@ namespace HyperBooru.Migrations
b.Property<int>("Source")
.HasColumnType("INTEGER");
- b.HasIndex("DbTagDefinitionObjectId");
+ b.Property<int?>("TagDefinitionObjectId")
+ .HasColumnType("INTEGER");
+
+ b.HasIndex("TagDefinitionObjectId");
b.ToTable("TagDefinitions", (string)null);
@@ -143,24 +140,22 @@ namespace HyperBooru.Migrations
new
{
ObjectId = -1,
- Guid = new Guid("a03e1649-bd30-4db1-a81d-be05ba05f357"),
- ObjectType = 0,
+ Guid = new Guid("cbd871cb-8790-4519-9f74-90d1e13a48a0"),
Name = "nsfw",
Source = 0
},
new
{
ObjectId = -2,
- Guid = new Guid("3094fe00-8e41-4c08-8828-dea2ba878dd4"),
- ObjectType = 0,
+ Guid = new Guid("716ac11f-135a-433c-84a7-7bdfddbec004"),
Name = "ingest",
Source = 0
});
});
- modelBuilder.Entity("HyperBooru.DbUploadedFile", b =>
+ modelBuilder.Entity("HyperBooru.UploadedFile", b =>
{
- b.HasOne("HyperBooru.DbMedia", "Media")
+ b.HasOne("HyperBooru.Media", "Media")
.WithMany("UploadedFiles")
.HasForeignKey("MediaObjectId")
.OnDelete(DeleteBehavior.Cascade)
@@ -169,30 +164,30 @@ namespace HyperBooru.Migrations
b.Navigation("Media");
});
- modelBuilder.Entity("HyperBooru.DbMedia", b =>
+ modelBuilder.Entity("HyperBooru.Media", b =>
{
- b.HasOne("HyperBooru.DbObject", null)
+ b.HasOne("HyperBooru.HBObject", null)
.WithOne()
- .HasForeignKey("HyperBooru.DbMedia", "ObjectId")
+ .HasForeignKey("HyperBooru.Media", "ObjectId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
- modelBuilder.Entity("HyperBooru.DbTag", b =>
+ modelBuilder.Entity("HyperBooru.Tag", b =>
{
- b.HasOne("HyperBooru.DbObject", null)
+ b.HasOne("HyperBooru.HBObject", null)
.WithOne()
- .HasForeignKey("HyperBooru.DbTag", "ObjectId")
+ .HasForeignKey("HyperBooru.Tag", "ObjectId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
- b.HasOne("HyperBooru.DbTagDefinition", "TagDefinition")
+ b.HasOne("HyperBooru.TagDefinition", "TagDefinition")
.WithMany()
.HasForeignKey("TagDefinitionObjectId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
- b.HasOne("HyperBooru.DbObject", "Target")
+ b.HasOne("HyperBooru.HBObject", "Target")
.WithMany("Tags")
.HasForeignKey("TargetObjectId")
.OnDelete(DeleteBehavior.Cascade)
@@ -203,30 +198,30 @@ namespace HyperBooru.Migrations
b.Navigation("Target");
});
- modelBuilder.Entity("HyperBooru.DbTagDefinition", b =>
+ modelBuilder.Entity("HyperBooru.TagDefinition", b =>
{
- b.HasOne("HyperBooru.DbTagDefinition", null)
- .WithMany("ImplicitTags")
- .HasForeignKey("DbTagDefinitionObjectId");
-
- b.HasOne("HyperBooru.DbObject", null)
+ b.HasOne("HyperBooru.HBObject", null)
.WithOne()
- .HasForeignKey("HyperBooru.DbTagDefinition", "ObjectId")
+ .HasForeignKey("HyperBooru.TagDefinition", "ObjectId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
+
+ b.HasOne("HyperBooru.TagDefinition", null)
+ .WithMany("ImplicitTags")
+ .HasForeignKey("TagDefinitionObjectId");
});
- modelBuilder.Entity("HyperBooru.DbObject", b =>
+ modelBuilder.Entity("HyperBooru.HBObject", b =>
{
b.Navigation("Tags");
});
- modelBuilder.Entity("HyperBooru.DbMedia", b =>
+ modelBuilder.Entity("HyperBooru.Media", b =>
{
b.Navigation("UploadedFiles");
});
- modelBuilder.Entity("HyperBooru.DbTagDefinition", b =>
+ modelBuilder.Entity("HyperBooru.TagDefinition", b =>
{
b.Navigation("ImplicitTags");
});