[FA-4] Adds an event bus infrastructure, a RabbitMQ implementation and rewires existing mutations on NovelService to utilize it.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using FictionArchive.Service.NovelService.Services;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
@@ -12,7 +13,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
namespace FictionArchive.Service.NovelService.Migrations
|
||||
{
|
||||
[DbContext(typeof(NovelServiceDbContext))]
|
||||
[Migration("20251118045235_Initial")]
|
||||
[Migration("20251120012317_Initial")]
|
||||
partial class Initial
|
||||
{
|
||||
/// <inheritdoc />
|
||||
@@ -27,11 +28,9 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
|
||||
modelBuilder.Entity("FictionArchive.Service.NovelService.Models.Localization.LocalizationKey", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Instant>("CreatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
@@ -41,16 +40,44 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("LocalizationKey");
|
||||
b.ToTable("LocalizationKeys");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FictionArchive.Service.NovelService.Models.Localization.LocalizationRequest", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Instant>("CreatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<long>("EngineId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<Guid>("KeyRequestedForTranslationId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Instant>("LastUpdatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<int>("TranslateTo")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EngineId");
|
||||
|
||||
b.HasIndex("KeyRequestedForTranslationId");
|
||||
|
||||
b.ToTable("LocalizationRequests");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FictionArchive.Service.NovelService.Models.Localization.LocalizationText", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Instant>("CreatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
@@ -61,8 +88,8 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
b.Property<Instant>("LastUpdatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<long?>("LocalizationKeyId")
|
||||
.HasColumnType("bigint");
|
||||
b.Property<Guid?>("LocalizationKeyId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
@@ -88,8 +115,8 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||
|
||||
b.Property<long>("BodyId")
|
||||
.HasColumnType("bigint");
|
||||
b.Property<Guid>("BodyId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Instant>("CreatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
@@ -97,8 +124,8 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
b.Property<Instant>("LastUpdatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<long>("NameId")
|
||||
.HasColumnType("bigint");
|
||||
b.Property<Guid>("NameId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<long?>("NovelId")
|
||||
.HasColumnType("bigint");
|
||||
@@ -137,8 +164,8 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
b.Property<Instant>("CreatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<long>("DescriptionId")
|
||||
.HasColumnType("bigint");
|
||||
b.Property<Guid>("DescriptionId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ExternalId")
|
||||
.IsRequired()
|
||||
@@ -147,8 +174,8 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
b.Property<Instant>("LastUpdatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<long>("NameId")
|
||||
.HasColumnType("bigint");
|
||||
b.Property<Guid>("NameId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("RawLanguage")
|
||||
.HasColumnType("integer");
|
||||
@@ -190,8 +217,8 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
b.Property<Instant>("CreatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<long>("DisplayNameId")
|
||||
.HasColumnType("bigint");
|
||||
b.Property<Guid>("DisplayNameId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
@@ -232,12 +259,13 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
b.Property<Instant>("LastUpdatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
b.Property<Guid>("NameId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NameId");
|
||||
|
||||
b.ToTable("Person");
|
||||
});
|
||||
|
||||
@@ -283,10 +311,6 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
b.Property<Instant>("CreatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("DisplayName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
@@ -314,6 +338,25 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
b.ToTable("NovelNovelTag");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FictionArchive.Service.NovelService.Models.Localization.LocalizationRequest", b =>
|
||||
{
|
||||
b.HasOne("FictionArchive.Service.NovelService.Models.Novels.TranslationEngine", "Engine")
|
||||
.WithMany()
|
||||
.HasForeignKey("EngineId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("FictionArchive.Service.NovelService.Models.Localization.LocalizationKey", "KeyRequestedForTranslation")
|
||||
.WithMany()
|
||||
.HasForeignKey("KeyRequestedForTranslationId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Engine");
|
||||
|
||||
b.Navigation("KeyRequestedForTranslation");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FictionArchive.Service.NovelService.Models.Localization.LocalizationText", b =>
|
||||
{
|
||||
b.HasOne("FictionArchive.Service.NovelService.Models.Localization.LocalizationKey", null)
|
||||
@@ -402,6 +445,17 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
b.Navigation("Source");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FictionArchive.Service.NovelService.Models.Novels.Person", b =>
|
||||
{
|
||||
b.HasOne("FictionArchive.Service.NovelService.Models.Localization.LocalizationKey", "Name")
|
||||
.WithMany()
|
||||
.HasForeignKey("NameId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Name");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("NovelNovelTag", b =>
|
||||
{
|
||||
b.HasOne("FictionArchive.Service.NovelService.Models.Novels.Novel", null)
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using NodaTime;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
@@ -13,33 +14,16 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "LocalizationKey",
|
||||
name: "LocalizationKeys",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
CreatedTime = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||
LastUpdatedTime = table.Column<Instant>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_LocalizationKey", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Person",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
ExternalUrl = table.Column<string>(type: "text", nullable: true),
|
||||
CreatedTime = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||
LastUpdatedTime = table.Column<Instant>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Person", x => x.Id);
|
||||
table.PrimaryKey("PK_LocalizationKeys", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
@@ -66,7 +50,6 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Key = table.Column<string>(type: "text", nullable: false),
|
||||
DisplayName = table.Column<string>(type: "text", nullable: false),
|
||||
CreatedTime = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||
LastUpdatedTime = table.Column<Instant>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
@@ -75,6 +58,112 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
table.PrimaryKey("PK_TranslationEngines", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Person",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
NameId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ExternalUrl = table.Column<string>(type: "text", nullable: true),
|
||||
CreatedTime = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||
LastUpdatedTime = table.Column<Instant>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Person", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Person_LocalizationKeys_NameId",
|
||||
column: x => x.NameId,
|
||||
principalTable: "LocalizationKeys",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Tags",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Key = table.Column<string>(type: "text", nullable: false),
|
||||
DisplayNameId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
TagType = table.Column<int>(type: "integer", nullable: false),
|
||||
SourceId = table.Column<long>(type: "bigint", nullable: true),
|
||||
CreatedTime = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||
LastUpdatedTime = table.Column<Instant>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Tags", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Tags_LocalizationKeys_DisplayNameId",
|
||||
column: x => x.DisplayNameId,
|
||||
principalTable: "LocalizationKeys",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_Tags_Sources_SourceId",
|
||||
column: x => x.SourceId,
|
||||
principalTable: "Sources",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "LocalizationRequests",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
KeyRequestedForTranslationId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
TranslateTo = table.Column<int>(type: "integer", nullable: false),
|
||||
EngineId = table.Column<long>(type: "bigint", nullable: false),
|
||||
CreatedTime = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||
LastUpdatedTime = table.Column<Instant>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_LocalizationRequests", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_LocalizationRequests_LocalizationKeys_KeyRequestedForTransl~",
|
||||
column: x => x.KeyRequestedForTranslationId,
|
||||
principalTable: "LocalizationKeys",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_LocalizationRequests_TranslationEngines_EngineId",
|
||||
column: x => x.EngineId,
|
||||
principalTable: "TranslationEngines",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "LocalizationText",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Language = table.Column<int>(type: "integer", nullable: false),
|
||||
Text = table.Column<string>(type: "text", nullable: false),
|
||||
TranslationEngineId = table.Column<long>(type: "bigint", nullable: true),
|
||||
LocalizationKeyId = table.Column<Guid>(type: "uuid", nullable: true),
|
||||
CreatedTime = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||
LastUpdatedTime = table.Column<Instant>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_LocalizationText", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_LocalizationText_LocalizationKeys_LocalizationKeyId",
|
||||
column: x => x.LocalizationKeyId,
|
||||
principalTable: "LocalizationKeys",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_LocalizationText_TranslationEngines_TranslationEngineId",
|
||||
column: x => x.TranslationEngineId,
|
||||
principalTable: "TranslationEngines",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Novels",
|
||||
columns: table => new
|
||||
@@ -88,8 +177,8 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
StatusOverride = table.Column<int>(type: "integer", nullable: true),
|
||||
SourceId = table.Column<long>(type: "bigint", nullable: false),
|
||||
ExternalId = table.Column<string>(type: "text", nullable: false),
|
||||
NameId = table.Column<long>(type: "bigint", nullable: false),
|
||||
DescriptionId = table.Column<long>(type: "bigint", nullable: false),
|
||||
NameId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
DescriptionId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
CreatedTime = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||
LastUpdatedTime = table.Column<Instant>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
@@ -97,15 +186,15 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
{
|
||||
table.PrimaryKey("PK_Novels", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Novels_LocalizationKey_DescriptionId",
|
||||
name: "FK_Novels_LocalizationKeys_DescriptionId",
|
||||
column: x => x.DescriptionId,
|
||||
principalTable: "LocalizationKey",
|
||||
principalTable: "LocalizationKeys",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_Novels_LocalizationKey_NameId",
|
||||
name: "FK_Novels_LocalizationKeys_NameId",
|
||||
column: x => x.NameId,
|
||||
principalTable: "LocalizationKey",
|
||||
principalTable: "LocalizationKeys",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
@@ -122,63 +211,6 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Tags",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Key = table.Column<string>(type: "text", nullable: false),
|
||||
DisplayNameId = table.Column<long>(type: "bigint", nullable: false),
|
||||
TagType = table.Column<int>(type: "integer", nullable: false),
|
||||
SourceId = table.Column<long>(type: "bigint", nullable: true),
|
||||
CreatedTime = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||
LastUpdatedTime = table.Column<Instant>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Tags", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Tags_LocalizationKey_DisplayNameId",
|
||||
column: x => x.DisplayNameId,
|
||||
principalTable: "LocalizationKey",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_Tags_Sources_SourceId",
|
||||
column: x => x.SourceId,
|
||||
principalTable: "Sources",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "LocalizationText",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Language = table.Column<int>(type: "integer", nullable: false),
|
||||
Text = table.Column<string>(type: "text", nullable: false),
|
||||
TranslationEngineId = table.Column<long>(type: "bigint", nullable: true),
|
||||
LocalizationKeyId = table.Column<long>(type: "bigint", nullable: true),
|
||||
CreatedTime = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||
LastUpdatedTime = table.Column<Instant>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_LocalizationText", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_LocalizationText_LocalizationKey_LocalizationKeyId",
|
||||
column: x => x.LocalizationKeyId,
|
||||
principalTable: "LocalizationKey",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_LocalizationText_TranslationEngines_TranslationEngineId",
|
||||
column: x => x.TranslationEngineId,
|
||||
principalTable: "TranslationEngines",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Chapter",
|
||||
columns: table => new
|
||||
@@ -188,8 +220,8 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
Revision = table.Column<long>(type: "bigint", nullable: false),
|
||||
Order = table.Column<long>(type: "bigint", nullable: false),
|
||||
Url = table.Column<string>(type: "text", nullable: true),
|
||||
NameId = table.Column<long>(type: "bigint", nullable: false),
|
||||
BodyId = table.Column<long>(type: "bigint", nullable: false),
|
||||
NameId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
BodyId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
NovelId = table.Column<long>(type: "bigint", nullable: true),
|
||||
CreatedTime = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||
LastUpdatedTime = table.Column<Instant>(type: "timestamp with time zone", nullable: false)
|
||||
@@ -198,15 +230,15 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
{
|
||||
table.PrimaryKey("PK_Chapter", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Chapter_LocalizationKey_BodyId",
|
||||
name: "FK_Chapter_LocalizationKeys_BodyId",
|
||||
column: x => x.BodyId,
|
||||
principalTable: "LocalizationKey",
|
||||
principalTable: "LocalizationKeys",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_Chapter_LocalizationKey_NameId",
|
||||
name: "FK_Chapter_LocalizationKeys_NameId",
|
||||
column: x => x.NameId,
|
||||
principalTable: "LocalizationKey",
|
||||
principalTable: "LocalizationKeys",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
@@ -255,6 +287,16 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
table: "Chapter",
|
||||
column: "NovelId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_LocalizationRequests_EngineId",
|
||||
table: "LocalizationRequests",
|
||||
column: "EngineId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_LocalizationRequests_KeyRequestedForTranslationId",
|
||||
table: "LocalizationRequests",
|
||||
column: "KeyRequestedForTranslationId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_LocalizationText_LocalizationKeyId",
|
||||
table: "LocalizationText",
|
||||
@@ -290,6 +332,11 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
table: "Novels",
|
||||
column: "SourceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Person_NameId",
|
||||
table: "Person",
|
||||
column: "NameId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Tags_DisplayNameId",
|
||||
table: "Tags",
|
||||
@@ -307,6 +354,9 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
migrationBuilder.DropTable(
|
||||
name: "Chapter");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "LocalizationRequests");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "LocalizationText");
|
||||
|
||||
@@ -326,10 +376,10 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
name: "Person");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "LocalizationKey");
|
||||
name: "Sources");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Sources");
|
||||
name: "LocalizationKeys");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using FictionArchive.Service.NovelService.Services;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
@@ -24,11 +25,9 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
|
||||
modelBuilder.Entity("FictionArchive.Service.NovelService.Models.Localization.LocalizationKey", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Instant>("CreatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
@@ -38,16 +37,44 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("LocalizationKey");
|
||||
b.ToTable("LocalizationKeys");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FictionArchive.Service.NovelService.Models.Localization.LocalizationRequest", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Instant>("CreatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<long>("EngineId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<Guid>("KeyRequestedForTranslationId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Instant>("LastUpdatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<int>("TranslateTo")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EngineId");
|
||||
|
||||
b.HasIndex("KeyRequestedForTranslationId");
|
||||
|
||||
b.ToTable("LocalizationRequests");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FictionArchive.Service.NovelService.Models.Localization.LocalizationText", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Instant>("CreatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
@@ -58,8 +85,8 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
b.Property<Instant>("LastUpdatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<long?>("LocalizationKeyId")
|
||||
.HasColumnType("bigint");
|
||||
b.Property<Guid?>("LocalizationKeyId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
@@ -85,8 +112,8 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||
|
||||
b.Property<long>("BodyId")
|
||||
.HasColumnType("bigint");
|
||||
b.Property<Guid>("BodyId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Instant>("CreatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
@@ -94,8 +121,8 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
b.Property<Instant>("LastUpdatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<long>("NameId")
|
||||
.HasColumnType("bigint");
|
||||
b.Property<Guid>("NameId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<long?>("NovelId")
|
||||
.HasColumnType("bigint");
|
||||
@@ -134,8 +161,8 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
b.Property<Instant>("CreatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<long>("DescriptionId")
|
||||
.HasColumnType("bigint");
|
||||
b.Property<Guid>("DescriptionId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ExternalId")
|
||||
.IsRequired()
|
||||
@@ -144,8 +171,8 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
b.Property<Instant>("LastUpdatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<long>("NameId")
|
||||
.HasColumnType("bigint");
|
||||
b.Property<Guid>("NameId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("RawLanguage")
|
||||
.HasColumnType("integer");
|
||||
@@ -187,8 +214,8 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
b.Property<Instant>("CreatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<long>("DisplayNameId")
|
||||
.HasColumnType("bigint");
|
||||
b.Property<Guid>("DisplayNameId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
@@ -229,12 +256,13 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
b.Property<Instant>("LastUpdatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
b.Property<Guid>("NameId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NameId");
|
||||
|
||||
b.ToTable("Person");
|
||||
});
|
||||
|
||||
@@ -280,10 +308,6 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
b.Property<Instant>("CreatedTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("DisplayName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
@@ -311,6 +335,25 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
b.ToTable("NovelNovelTag");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FictionArchive.Service.NovelService.Models.Localization.LocalizationRequest", b =>
|
||||
{
|
||||
b.HasOne("FictionArchive.Service.NovelService.Models.Novels.TranslationEngine", "Engine")
|
||||
.WithMany()
|
||||
.HasForeignKey("EngineId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("FictionArchive.Service.NovelService.Models.Localization.LocalizationKey", "KeyRequestedForTranslation")
|
||||
.WithMany()
|
||||
.HasForeignKey("KeyRequestedForTranslationId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Engine");
|
||||
|
||||
b.Navigation("KeyRequestedForTranslation");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FictionArchive.Service.NovelService.Models.Localization.LocalizationText", b =>
|
||||
{
|
||||
b.HasOne("FictionArchive.Service.NovelService.Models.Localization.LocalizationKey", null)
|
||||
@@ -399,6 +442,17 @@ namespace FictionArchive.Service.NovelService.Migrations
|
||||
b.Navigation("Source");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FictionArchive.Service.NovelService.Models.Novels.Person", b =>
|
||||
{
|
||||
b.HasOne("FictionArchive.Service.NovelService.Models.Localization.LocalizationKey", "Name")
|
||||
.WithMany()
|
||||
.HasForeignKey("NameId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Name");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("NovelNovelTag", b =>
|
||||
{
|
||||
b.HasOne("FictionArchive.Service.NovelService.Models.Novels.Novel", null)
|
||||
|
||||
Reference in New Issue
Block a user