From 1d2ca4d76a92ee1ef1385c8bb17bc084cde0fa0f Mon Sep 17 00:00:00 2001 From: Glax Date: Mon, 3 Mar 2025 21:13:18 +0100 Subject: [PATCH] Dependency Updates and Migrations --- API/API.csproj | 14 +- .../20250111180034_ChapterNumber.cs | 54 -- ...> 20250303141044_dev-030325-1.Designer.cs} | 25 +- ...tial.cs => 20250303141044_dev-030325-1.cs} | 385 +++++----- ...> 20250303145324_dev-030325-2.Designer.cs} | 391 ++++------ API/Migrations/20250303145324_dev-030325-2.cs | 34 + .../20250303152212_dev-030325-3.Designer.cs | 672 ++++++++++++++++++ API/Migrations/20250303152212_dev-030325-3.cs | 22 + API/Migrations/PgsqlContextModelSnapshot.cs | 25 +- 9 files changed, 1042 insertions(+), 580 deletions(-) delete mode 100644 API/Migrations/20250111180034_ChapterNumber.cs rename API/Migrations/{20250111180034_ChapterNumber.Designer.cs => 20250303141044_dev-030325-1.Designer.cs} (96%) rename API/Migrations/{20241201235443_Initial.cs => 20250303141044_dev-030325-1.cs} (65%) rename API/Migrations/{20241201235443_Initial.Designer.cs => 20250303145324_dev-030325-2.Designer.cs} (69%) create mode 100644 API/Migrations/20250303145324_dev-030325-2.cs create mode 100644 API/Migrations/20250303152212_dev-030325-3.Designer.cs create mode 100644 API/Migrations/20250303152212_dev-030325-3.cs diff --git a/API/API.csproj b/API/API.csproj index cf8c21c..80a3aea 100644 --- a/API/API.csproj +++ b/API/API.csproj @@ -11,7 +11,7 @@ - + @@ -20,13 +20,13 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - - - - + + + + diff --git a/API/Migrations/20250111180034_ChapterNumber.cs b/API/Migrations/20250111180034_ChapterNumber.cs deleted file mode 100644 index ef0ba03..0000000 --- a/API/Migrations/20250111180034_ChapterNumber.cs +++ /dev/null @@ -1,54 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace API.Migrations -{ - /// - public partial class ChapterNumber : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "VolumeNumber", - table: "Chapters", - type: "integer", - nullable: true, - oldClrType: typeof(float), - oldType: "real", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "ChapterNumber", - table: "Chapters", - type: "character varying(10)", - maxLength: 10, - nullable: false, - oldClrType: typeof(float), - oldType: "real"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "VolumeNumber", - table: "Chapters", - type: "real", - nullable: true, - oldClrType: typeof(int), - oldType: "integer", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "ChapterNumber", - table: "Chapters", - type: "real", - nullable: false, - oldClrType: typeof(string), - oldType: "character varying(10)", - oldMaxLength: 10); - } - } -} diff --git a/API/Migrations/20250111180034_ChapterNumber.Designer.cs b/API/Migrations/20250303141044_dev-030325-1.Designer.cs similarity index 96% rename from API/Migrations/20250111180034_ChapterNumber.Designer.cs rename to API/Migrations/20250303141044_dev-030325-1.Designer.cs index e330827..967b398 100644 --- a/API/Migrations/20250111180034_ChapterNumber.Designer.cs +++ b/API/Migrations/20250303141044_dev-030325-1.Designer.cs @@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace API.Migrations { [DbContext(typeof(PgsqlContext))] - [Migration("20250111180034_ChapterNumber")] - partial class ChapterNumber + [Migration("20250303141044_dev-030325-1")] + partial class dev0303251 { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -471,27 +471,6 @@ namespace API.Migrations b.HasDiscriminator().HasValue("MangaKatana"); }); - modelBuilder.Entity("API.Schema.MangaConnectors.MangaLife", b => - { - b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); - - b.HasDiscriminator().HasValue("Manga4Life"); - }); - - modelBuilder.Entity("API.Schema.MangaConnectors.Manganato", b => - { - b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); - - b.HasDiscriminator().HasValue("Manganato"); - }); - - modelBuilder.Entity("API.Schema.MangaConnectors.Mangasee", b => - { - b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); - - b.HasDiscriminator().HasValue("Mangasee"); - }); - modelBuilder.Entity("API.Schema.MangaConnectors.Mangaworld", b => { b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); diff --git a/API/Migrations/20241201235443_Initial.cs b/API/Migrations/20250303141044_dev-030325-1.cs similarity index 65% rename from API/Migrations/20241201235443_Initial.cs rename to API/Migrations/20250303141044_dev-030325-1.cs index 62c7b10..4204f5d 100644 --- a/API/Migrations/20241201235443_Initial.cs +++ b/API/Migrations/20250303141044_dev-030325-1.cs @@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace API.Migrations { /// - public partial class Initial : Migration + public partial class dev0303251 : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) @@ -68,6 +68,21 @@ namespace API.Migrations table.PrimaryKey("PK_NotificationConnectors", x => x.NotificationConnectorId); }); + migrationBuilder.CreateTable( + name: "Notifications", + columns: table => new + { + NotificationId = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + Urgency = table.Column(type: "smallint", nullable: false), + Title = table.Column(type: "text", nullable: false), + Message = table.Column(type: "text", nullable: false), + Date = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Notifications", x => x.NotificationId); + }); + migrationBuilder.CreateTable( name: "Tags", columns: table => new @@ -79,40 +94,6 @@ namespace API.Migrations table.PrimaryKey("PK_Tags", x => x.Tag); }); - migrationBuilder.CreateTable( - name: "AltTitles", - columns: table => new - { - AltTitleId = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), - Language = table.Column(type: "character varying(8)", maxLength: 8, nullable: false), - Title = table.Column(type: "text", nullable: false), - MangaId = table.Column(type: "character varying(64)", nullable: false), - AltTitleIds = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AltTitles", x => x.AltTitleId); - }); - - migrationBuilder.CreateTable( - name: "Chapters", - columns: table => new - { - ChapterId = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), - VolumeNumber = table.Column(type: "real", nullable: true), - ChapterNumber = table.Column(type: "real", nullable: false), - Url = table.Column(type: "text", nullable: false), - Title = table.Column(type: "text", nullable: true), - ArchiveFileName = table.Column(type: "text", nullable: false), - Downloaded = table.Column(type: "boolean", nullable: false), - ParentMangaId = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), - ChapterIds = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Chapters", x => x.ChapterId); - }); - migrationBuilder.CreateTable( name: "Manga", columns: table => new @@ -121,70 +102,153 @@ namespace API.Migrations ConnectorId = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), Name = table.Column(type: "text", nullable: false), Description = table.Column(type: "text", nullable: false), + WebsiteUrl = table.Column(type: "text", nullable: false), CoverUrl = table.Column(type: "text", nullable: false), CoverFileNameInCache = table.Column(type: "text", nullable: true), - year = table.Column(type: "bigint", nullable: false), + Year = table.Column(type: "bigint", nullable: false), OriginalLanguage = table.Column(type: "text", nullable: true), ReleaseStatus = table.Column(type: "smallint", nullable: false), FolderName = table.Column(type: "text", nullable: false), IgnoreChapterBefore = table.Column(type: "real", nullable: false), - LatestChapterDownloadedId = table.Column(type: "character varying(64)", nullable: true), - LatestChapterAvailableId = table.Column(type: "character varying(64)", nullable: true), - MangaConnectorName = table.Column(type: "character varying(32)", nullable: false), - AuthorIds = table.Column(type: "text[]", nullable: false), - TagIds = table.Column(type: "text[]", nullable: false), - LinkIds = table.Column(type: "text[]", nullable: false), - AltTitleIds = table.Column(type: "text[]", nullable: false), - MangaIds = table.Column(type: "text", nullable: false) + MangaConnectorId = table.Column(type: "character varying(32)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Manga", x => x.MangaId); table.ForeignKey( - name: "FK_Manga_Chapters_LatestChapterAvailableId", - column: x => x.LatestChapterAvailableId, - principalTable: "Chapters", - principalColumn: "ChapterId"); - table.ForeignKey( - name: "FK_Manga_Chapters_LatestChapterDownloadedId", - column: x => x.LatestChapterDownloadedId, - principalTable: "Chapters", - principalColumn: "ChapterId"); - table.ForeignKey( - name: "FK_Manga_MangaConnectors_MangaConnectorName", - column: x => x.MangaConnectorName, + name: "FK_Manga_MangaConnectors_MangaConnectorId", + column: x => x.MangaConnectorId, principalTable: "MangaConnectors", principalColumn: "Name", onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "AltTitles", + columns: table => new + { + AltTitleId = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + Language = table.Column(type: "character varying(8)", maxLength: 8, nullable: false), + Title = table.Column(type: "text", nullable: false), + MangaId = table.Column(type: "character varying(64)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AltTitles", x => x.AltTitleId); + table.ForeignKey( + name: "FK_AltTitles_Manga_MangaId", + column: x => x.MangaId, + principalTable: "Manga", + principalColumn: "MangaId"); + }); + + migrationBuilder.CreateTable( + name: "AuthorManga", + columns: table => new + { + AuthorsAuthorId = table.Column(type: "character varying(64)", nullable: false), + MangaId = table.Column(type: "character varying(64)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AuthorManga", x => new { x.AuthorsAuthorId, x.MangaId }); + table.ForeignKey( + name: "FK_AuthorManga_Authors_AuthorsAuthorId", + column: x => x.AuthorsAuthorId, + principalTable: "Authors", + principalColumn: "AuthorId", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AuthorManga_Manga_MangaId", + column: x => x.MangaId, + principalTable: "Manga", + principalColumn: "MangaId", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Chapters", + columns: table => new + { + ChapterId = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + VolumeNumber = table.Column(type: "integer", nullable: true), + ChapterNumber = table.Column(type: "character varying(10)", maxLength: 10, nullable: false), + Url = table.Column(type: "text", nullable: false), + Title = table.Column(type: "text", nullable: true), + ArchiveFileName = table.Column(type: "text", nullable: false), + Downloaded = table.Column(type: "boolean", nullable: false), + ParentMangaId = table.Column(type: "character varying(64)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Chapters", x => x.ChapterId); + table.ForeignKey( + name: "FK_Chapters_Manga_ParentMangaId", + column: x => x.ParentMangaId, + principalTable: "Manga", + principalColumn: "MangaId", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Link", + columns: table => new + { + LinkId = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + LinkProvider = table.Column(type: "text", nullable: false), + LinkUrl = table.Column(type: "text", nullable: false), + MangaId = table.Column(type: "character varying(64)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Link", x => x.LinkId); + table.ForeignKey( + name: "FK_Link_Manga_MangaId", + column: x => x.MangaId, + principalTable: "Manga", + principalColumn: "MangaId"); + }); + + migrationBuilder.CreateTable( + name: "MangaMangaTag", + columns: table => new + { + MangaId = table.Column(type: "character varying(64)", nullable: false), + TagsTag = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_MangaMangaTag", x => new { x.MangaId, x.TagsTag }); + table.ForeignKey( + name: "FK_MangaMangaTag_Manga_MangaId", + column: x => x.MangaId, + principalTable: "Manga", + principalColumn: "MangaId", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_MangaMangaTag_Tags_TagsTag", + column: x => x.TagsTag, + principalTable: "Tags", + principalColumn: "Tag", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "Jobs", columns: table => new { JobId = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), ParentJobId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), - DependsOnJobIds = table.Column(type: "text[]", maxLength: 64, nullable: true), + DependsOnJobsIds = table.Column(type: "text[]", maxLength: 64, nullable: true), JobType = table.Column(type: "smallint", nullable: false), RecurrenceMs = table.Column(type: "numeric(20,0)", nullable: false), LastExecution = table.Column(type: "timestamp with time zone", nullable: false), - NextExecution = table.Column(type: "timestamp with time zone", nullable: false), state = table.Column(type: "integer", nullable: false), JobId1 = table.Column(type: "character varying(64)", nullable: true), - ImagesLocation = table.Column(type: "text", nullable: true), - ComicInfoLocation = table.Column(type: "text", nullable: true), - CreateArchiveJob_ChapterId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), - Path = table.Column(type: "text", nullable: true), - CreateComicInfoXmlJob_ChapterId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), MangaId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), ChapterId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), FromLocation = table.Column(type: "text", nullable: true), ToLocation = table.Column(type: "text", nullable: true), - ProcessImagesJob_Path = table.Column(type: "text", nullable: true), - Bw = table.Column(type: "boolean", nullable: true), - Compression = table.Column(type: "integer", nullable: true), - SearchString = table.Column(type: "text", nullable: true), - MangaConnectorName = table.Column(type: "text", nullable: true), UpdateMetadataJob_MangaId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true) }, constraints: table => @@ -196,23 +260,16 @@ namespace API.Migrations principalTable: "Chapters", principalColumn: "ChapterId", onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Jobs_Chapters_CreateArchiveJob_ChapterId", - column: x => x.CreateArchiveJob_ChapterId, - principalTable: "Chapters", - principalColumn: "ChapterId", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Jobs_Chapters_CreateComicInfoXmlJob_ChapterId", - column: x => x.CreateComicInfoXmlJob_ChapterId, - principalTable: "Chapters", - principalColumn: "ChapterId", - onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Jobs_Jobs_JobId1", column: x => x.JobId1, principalTable: "Jobs", principalColumn: "JobId"); + table.ForeignKey( + name: "FK_Jobs_Jobs_ParentJobId", + column: x => x.ParentJobId, + principalTable: "Jobs", + principalColumn: "JobId"); table.ForeignKey( name: "FK_Jobs_Manga_MangaId", column: x => x.MangaId, @@ -227,90 +284,16 @@ namespace API.Migrations onDelete: ReferentialAction.Cascade); }); - migrationBuilder.CreateTable( - name: "Link", - columns: table => new - { - LinkId = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), - LinkProvider = table.Column(type: "text", nullable: false), - LinkUrl = table.Column(type: "text", nullable: false), - MangaId = table.Column(type: "character varying(64)", nullable: false), - LinkIds = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Link", x => x.LinkId); - table.ForeignKey( - name: "FK_Link_Manga_MangaId", - column: x => x.MangaId, - principalTable: "Manga", - principalColumn: "MangaId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "MangaAuthor", - columns: table => new - { - MangaId = table.Column(type: "character varying(64)", nullable: false), - AuthorId = table.Column(type: "character varying(64)", nullable: false), - AuthorIds = table.Column(type: "text", nullable: true), - MangaIds = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_MangaAuthor", x => new { x.MangaId, x.AuthorId }); - table.ForeignKey( - name: "FK_MangaAuthor_Authors_AuthorId", - column: x => x.AuthorId, - principalTable: "Authors", - principalColumn: "AuthorId", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_MangaAuthor_Manga_MangaId", - column: x => x.MangaId, - principalTable: "Manga", - principalColumn: "MangaId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "MangaTag", - columns: table => new - { - MangaId = table.Column(type: "character varying(64)", nullable: false), - Tag = table.Column(type: "text", nullable: false), - MangaIds = table.Column(type: "text", nullable: false), - TagIds = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_MangaTag", x => new { x.MangaId, x.Tag }); - table.ForeignKey( - name: "FK_MangaTag_Manga_MangaId", - column: x => x.MangaId, - principalTable: "Manga", - principalColumn: "MangaId", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_MangaTag_Tags_MangaIds", - column: x => x.MangaIds, - principalTable: "Tags", - principalColumn: "Tag", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_MangaTag_Tags_Tag", - column: x => x.Tag, - principalTable: "Tags", - principalColumn: "Tag", - onDelete: ReferentialAction.Cascade); - }); - migrationBuilder.CreateIndex( name: "IX_AltTitles_MangaId", table: "AltTitles", column: "MangaId"); + migrationBuilder.CreateIndex( + name: "IX_AuthorManga_MangaId", + table: "AuthorManga", + column: "MangaId"); + migrationBuilder.CreateIndex( name: "IX_Chapters_ParentMangaId", table: "Chapters", @@ -321,16 +304,6 @@ namespace API.Migrations table: "Jobs", column: "ChapterId"); - migrationBuilder.CreateIndex( - name: "IX_Jobs_CreateArchiveJob_ChapterId", - table: "Jobs", - column: "CreateArchiveJob_ChapterId"); - - migrationBuilder.CreateIndex( - name: "IX_Jobs_CreateComicInfoXmlJob_ChapterId", - table: "Jobs", - column: "CreateComicInfoXmlJob_ChapterId"); - migrationBuilder.CreateIndex( name: "IX_Jobs_JobId1", table: "Jobs", @@ -341,6 +314,11 @@ namespace API.Migrations table: "Jobs", column: "MangaId"); + migrationBuilder.CreateIndex( + name: "IX_Jobs_ParentJobId", + table: "Jobs", + column: "ParentJobId"); + migrationBuilder.CreateIndex( name: "IX_Jobs_UpdateMetadataJob_MangaId", table: "Jobs", @@ -352,64 +330,25 @@ namespace API.Migrations column: "MangaId"); migrationBuilder.CreateIndex( - name: "IX_Manga_LatestChapterAvailableId", + name: "IX_Manga_MangaConnectorId", table: "Manga", - column: "LatestChapterAvailableId", - unique: true); + column: "MangaConnectorId"); migrationBuilder.CreateIndex( - name: "IX_Manga_LatestChapterDownloadedId", - table: "Manga", - column: "LatestChapterDownloadedId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Manga_MangaConnectorName", - table: "Manga", - column: "MangaConnectorName"); - - migrationBuilder.CreateIndex( - name: "IX_MangaAuthor_AuthorId", - table: "MangaAuthor", - column: "AuthorId"); - - migrationBuilder.CreateIndex( - name: "IX_MangaTag_MangaIds", - table: "MangaTag", - column: "MangaIds"); - - migrationBuilder.CreateIndex( - name: "IX_MangaTag_Tag", - table: "MangaTag", - column: "Tag"); - - migrationBuilder.AddForeignKey( - name: "FK_AltTitles_Manga_MangaId", - table: "AltTitles", - column: "MangaId", - principalTable: "Manga", - principalColumn: "MangaId", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Chapters_Manga_ParentMangaId", - table: "Chapters", - column: "ParentMangaId", - principalTable: "Manga", - principalColumn: "MangaId", - onDelete: ReferentialAction.Cascade); + name: "IX_MangaMangaTag_TagsTag", + table: "MangaMangaTag", + column: "TagsTag"); } /// protected override void Down(MigrationBuilder migrationBuilder) { - migrationBuilder.DropForeignKey( - name: "FK_Chapters_Manga_ParentMangaId", - table: "Chapters"); - migrationBuilder.DropTable( name: "AltTitles"); + migrationBuilder.DropTable( + name: "AuthorManga"); + migrationBuilder.DropTable( name: "Jobs"); @@ -420,26 +359,26 @@ namespace API.Migrations name: "Link"); migrationBuilder.DropTable( - name: "MangaAuthor"); - - migrationBuilder.DropTable( - name: "MangaTag"); + name: "MangaMangaTag"); migrationBuilder.DropTable( name: "NotificationConnectors"); + migrationBuilder.DropTable( + name: "Notifications"); + migrationBuilder.DropTable( name: "Authors"); + migrationBuilder.DropTable( + name: "Chapters"); + migrationBuilder.DropTable( name: "Tags"); migrationBuilder.DropTable( name: "Manga"); - migrationBuilder.DropTable( - name: "Chapters"); - migrationBuilder.DropTable( name: "MangaConnectors"); } diff --git a/API/Migrations/20241201235443_Initial.Designer.cs b/API/Migrations/20250303145324_dev-030325-2.Designer.cs similarity index 69% rename from API/Migrations/20241201235443_Initial.Designer.cs rename to API/Migrations/20250303145324_dev-030325-2.Designer.cs index d5f2e42..a28e0b6 100644 --- a/API/Migrations/20241201235443_Initial.Designer.cs +++ b/API/Migrations/20250303145324_dev-030325-2.Designer.cs @@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace API.Migrations { [DbContext(typeof(PgsqlContext))] - [Migration("20241201235443_Initial")] - partial class Initial + [Migration("20250303145324_dev-030325-2")] + partial class dev0303252 { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -50,19 +50,16 @@ namespace API.Migrations .IsRequired() .HasColumnType("text"); - b.Property("ChapterIds") + b.Property("ChapterNumber") .IsRequired() - .HasColumnType("text"); - - b.Property("ChapterNumber") - .HasColumnType("real"); + .HasMaxLength(10) + .HasColumnType("character varying(10)"); b.Property("Downloaded") .HasColumnType("boolean"); b.Property("ParentMangaId") .IsRequired() - .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("Title") @@ -72,8 +69,8 @@ namespace API.Migrations .IsRequired() .HasColumnType("text"); - b.Property("VolumeNumber") - .HasColumnType("real"); + b.Property("VolumeNumber") + .HasColumnType("integer"); b.HasKey("ChapterId"); @@ -88,7 +85,7 @@ namespace API.Migrations .HasMaxLength(64) .HasColumnType("character varying(64)"); - b.PrimitiveCollection("DependsOnJobIds") + b.PrimitiveCollection("DependsOnJobsIds") .HasMaxLength(64) .HasColumnType("text[]"); @@ -101,9 +98,6 @@ namespace API.Migrations b.Property("LastExecution") .HasColumnType("timestamp with time zone"); - b.Property("NextExecution") - .HasColumnType("timestamp with time zone"); - b.Property("ParentJobId") .HasMaxLength(64) .HasColumnType("character varying(64)"); @@ -111,13 +105,15 @@ namespace API.Migrations b.Property("RecurrenceMs") .HasColumnType("numeric(20,0)"); - b.Property("state") - .HasColumnType("integer"); + b.Property("state") + .HasColumnType("smallint"); b.HasKey("JobId"); b.HasIndex("JobId1"); + b.HasIndex("ParentJobId"); + b.ToTable("Jobs"); b.HasDiscriminator("JobType"); @@ -157,9 +153,6 @@ namespace API.Migrations .HasMaxLength(64) .HasColumnType("character varying(64)"); - b.Property("LinkIds") - .HasColumnType("text"); - b.Property("LinkProvider") .IsRequired() .HasColumnType("text"); @@ -169,7 +162,6 @@ namespace API.Migrations .HasColumnType("text"); b.Property("MangaId") - .IsRequired() .HasColumnType("character varying(64)"); b.HasKey("LinkId"); @@ -185,14 +177,6 @@ namespace API.Migrations .HasMaxLength(64) .HasColumnType("character varying(64)"); - b.PrimitiveCollection("AltTitleIds") - .IsRequired() - .HasColumnType("text[]"); - - b.PrimitiveCollection("AuthorIds") - .IsRequired() - .HasColumnType("text[]"); - b.Property("ConnectorId") .IsRequired() .HasMaxLength(64) @@ -216,24 +200,10 @@ namespace API.Migrations b.Property("IgnoreChapterBefore") .HasColumnType("real"); - b.Property("LatestChapterAvailableId") - .HasColumnType("character varying(64)"); - - b.Property("LatestChapterDownloadedId") - .HasColumnType("character varying(64)"); - - b.PrimitiveCollection("LinkIds") - .IsRequired() - .HasColumnType("text[]"); - - b.Property("MangaConnectorName") + b.Property("MangaConnectorId") .IsRequired() .HasColumnType("character varying(32)"); - b.Property("MangaIds") - .IsRequired() - .HasColumnType("text"); - b.Property("Name") .IsRequired() .HasColumnType("text"); @@ -244,22 +214,16 @@ namespace API.Migrations b.Property("ReleaseStatus") .HasColumnType("smallint"); - b.PrimitiveCollection("TagIds") + b.Property("WebsiteUrl") .IsRequired() - .HasColumnType("text[]"); + .HasColumnType("text"); - b.Property("year") + b.Property("Year") .HasColumnType("bigint"); b.HasKey("MangaId"); - b.HasIndex("LatestChapterAvailableId") - .IsUnique(); - - b.HasIndex("LatestChapterDownloadedId") - .IsUnique(); - - b.HasIndex("MangaConnectorName"); + b.HasIndex("MangaConnectorId"); b.ToTable("Manga"); }); @@ -270,16 +234,12 @@ namespace API.Migrations .HasMaxLength(64) .HasColumnType("character varying(64)"); - b.Property("AltTitleIds") - .HasColumnType("text"); - b.Property("Language") .IsRequired() .HasMaxLength(8) .HasColumnType("character varying(8)"); b.Property("MangaId") - .IsRequired() .HasColumnType("character varying(64)"); b.Property("Title") @@ -293,7 +253,7 @@ namespace API.Migrations b.ToTable("AltTitles"); }); - modelBuilder.Entity("API.Schema.MangaConnector", b => + modelBuilder.Entity("API.Schema.MangaConnectors.MangaConnector", b => { b.Property("Name") .HasMaxLength(32) @@ -310,6 +270,10 @@ namespace API.Migrations b.HasKey("Name"); b.ToTable("MangaConnectors"); + + b.HasDiscriminator("Name").HasValue("MangaConnector"); + + b.UseTphMappingStrategy(); }); modelBuilder.Entity("API.Schema.MangaTag", b => @@ -322,6 +286,31 @@ namespace API.Migrations b.ToTable("Tags"); }); + modelBuilder.Entity("API.Schema.Notification", b => + { + b.Property("NotificationId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Date") + .HasColumnType("timestamp with time zone"); + + b.Property("Message") + .IsRequired() + .HasColumnType("text"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.Property("Urgency") + .HasColumnType("smallint"); + + b.HasKey("NotificationId"); + + b.ToTable("Notifications"); + }); + modelBuilder.Entity("API.Schema.NotificationConnectors.NotificationConnector", b => { b.Property("NotificationConnectorId") @@ -340,101 +329,34 @@ namespace API.Migrations b.UseTphMappingStrategy(); }); - modelBuilder.Entity("MangaAuthor", b => + modelBuilder.Entity("AuthorManga", b => + { + b.Property("AuthorsAuthorId") + .HasColumnType("character varying(64)"); + + b.Property("MangaId") + .HasColumnType("character varying(64)"); + + b.HasKey("AuthorsAuthorId", "MangaId"); + + b.HasIndex("MangaId"); + + b.ToTable("AuthorManga"); + }); + + modelBuilder.Entity("MangaMangaTag", b => { b.Property("MangaId") .HasColumnType("character varying(64)"); - b.Property("AuthorId") - .HasColumnType("character varying(64)"); - - b.Property("AuthorIds") + b.Property("TagsTag") .HasColumnType("text"); - b.Property("MangaIds") - .HasColumnType("text"); + b.HasKey("MangaId", "TagsTag"); - b.HasKey("MangaId", "AuthorId"); + b.HasIndex("TagsTag"); - b.HasIndex("AuthorId"); - - b.ToTable("MangaAuthor"); - }); - - modelBuilder.Entity("MangaTag", b => - { - b.Property("MangaId") - .HasColumnType("character varying(64)"); - - b.Property("Tag") - .HasColumnType("text"); - - b.Property("MangaIds") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagIds") - .HasColumnType("text"); - - b.HasKey("MangaId", "Tag"); - - b.HasIndex("MangaIds"); - - b.HasIndex("Tag"); - - b.ToTable("MangaTag"); - }); - - modelBuilder.Entity("API.Schema.Jobs.CreateArchiveJob", b => - { - b.HasBaseType("API.Schema.Jobs.Job"); - - b.Property("ChapterId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ComicInfoLocation") - .IsRequired() - .HasColumnType("text"); - - b.Property("ImagesLocation") - .IsRequired() - .HasColumnType("text"); - - b.HasIndex("ChapterId"); - - b.ToTable("Jobs", t => - { - t.Property("ChapterId") - .HasColumnName("CreateArchiveJob_ChapterId"); - }); - - b.HasDiscriminator().HasValue((byte)4); - }); - - modelBuilder.Entity("API.Schema.Jobs.CreateComicInfoXmlJob", b => - { - b.HasBaseType("API.Schema.Jobs.Job"); - - b.Property("ChapterId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Path") - .IsRequired() - .HasColumnType("text"); - - b.HasIndex("ChapterId"); - - b.ToTable("Jobs", t => - { - t.Property("ChapterId") - .HasColumnName("CreateComicInfoXmlJob_ChapterId"); - }); - - b.HasDiscriminator().HasValue((byte)6); + b.ToTable("MangaMangaTag"); }); modelBuilder.Entity("API.Schema.Jobs.DownloadNewChaptersJob", b => @@ -480,44 +402,6 @@ namespace API.Migrations b.HasDiscriminator().HasValue((byte)3); }); - modelBuilder.Entity("API.Schema.Jobs.ProcessImagesJob", b => - { - b.HasBaseType("API.Schema.Jobs.Job"); - - b.Property("Bw") - .HasColumnType("boolean"); - - b.Property("Compression") - .HasColumnType("integer"); - - b.Property("Path") - .IsRequired() - .HasColumnType("text"); - - b.ToTable("Jobs", t => - { - t.Property("Path") - .HasColumnName("ProcessImagesJob_Path"); - }); - - b.HasDiscriminator().HasValue((byte)5); - }); - - modelBuilder.Entity("API.Schema.Jobs.SearchMangaJob", b => - { - b.HasBaseType("API.Schema.Jobs.Job"); - - b.Property("MangaConnectorName") - .IsRequired() - .HasColumnType("text"); - - b.Property("SearchString") - .IsRequired() - .HasColumnType("text"); - - b.HasDiscriminator().HasValue((byte)7); - }); - modelBuilder.Entity("API.Schema.Jobs.UpdateMetadataJob", b => { b.HasBaseType("API.Schema.Jobs.Job"); @@ -552,6 +436,62 @@ namespace API.Migrations b.HasDiscriminator().HasValue((byte)0); }); + modelBuilder.Entity("API.Schema.MangaConnectors.AsuraToon", b => + { + b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); + + b.HasDiscriminator().HasValue("AsuraToon"); + }); + + modelBuilder.Entity("API.Schema.MangaConnectors.Bato", b => + { + b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); + + b.HasDiscriminator().HasValue("Bato"); + }); + + modelBuilder.Entity("API.Schema.MangaConnectors.MangaDex", b => + { + b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); + + b.HasDiscriminator().HasValue("MangaDex"); + }); + + modelBuilder.Entity("API.Schema.MangaConnectors.MangaHere", b => + { + b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); + + b.HasDiscriminator().HasValue("MangaHere"); + }); + + modelBuilder.Entity("API.Schema.MangaConnectors.MangaKatana", b => + { + b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); + + b.HasDiscriminator().HasValue("MangaKatana"); + }); + + modelBuilder.Entity("API.Schema.MangaConnectors.Mangaworld", b => + { + b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); + + b.HasDiscriminator().HasValue("Mangaworld"); + }); + + modelBuilder.Entity("API.Schema.MangaConnectors.ManhuaPlus", b => + { + b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); + + b.HasDiscriminator().HasValue("ManhuaPlus"); + }); + + modelBuilder.Entity("API.Schema.MangaConnectors.Weebcentral", b => + { + b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); + + b.HasDiscriminator().HasValue("Weebcentral"); + }); + modelBuilder.Entity("API.Schema.NotificationConnectors.Gotify", b => { b.HasBaseType("API.Schema.NotificationConnectors.NotificationConnector"); @@ -606,7 +546,7 @@ namespace API.Migrations modelBuilder.Entity("API.Schema.Chapter", b => { b.HasOne("API.Schema.Manga", "ParentManga") - .WithMany("Chapters") + .WithMany() .HasForeignKey("ParentMangaId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); @@ -619,58 +559,44 @@ namespace API.Migrations b.HasOne("API.Schema.Jobs.Job", null) .WithMany("DependsOnJobs") .HasForeignKey("JobId1"); + + b.HasOne("API.Schema.Jobs.Job", "ParentJob") + .WithMany() + .HasForeignKey("ParentJobId"); + + b.Navigation("ParentJob"); }); modelBuilder.Entity("API.Schema.Link", b => { - b.HasOne("API.Schema.Manga", "Manga") + b.HasOne("API.Schema.Manga", null) .WithMany("Links") - .HasForeignKey("MangaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Manga"); + .HasForeignKey("MangaId"); }); modelBuilder.Entity("API.Schema.Manga", b => { - b.HasOne("API.Schema.Chapter", "LatestChapterAvailable") - .WithOne() - .HasForeignKey("API.Schema.Manga", "LatestChapterAvailableId"); - - b.HasOne("API.Schema.Chapter", "LatestChapterDownloaded") - .WithOne() - .HasForeignKey("API.Schema.Manga", "LatestChapterDownloadedId"); - - b.HasOne("API.Schema.MangaConnector", "MangaConnector") - .WithMany("Mangas") - .HasForeignKey("MangaConnectorName") + b.HasOne("API.Schema.MangaConnectors.MangaConnector", "MangaConnector") + .WithMany() + .HasForeignKey("MangaConnectorId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.Navigation("LatestChapterAvailable"); - - b.Navigation("LatestChapterDownloaded"); - b.Navigation("MangaConnector"); }); modelBuilder.Entity("API.Schema.MangaAltTitle", b => { - b.HasOne("API.Schema.Manga", "Manga") + b.HasOne("API.Schema.Manga", null) .WithMany("AltTitles") - .HasForeignKey("MangaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Manga"); + .HasForeignKey("MangaId"); }); - modelBuilder.Entity("MangaAuthor", b => + modelBuilder.Entity("AuthorManga", b => { b.HasOne("API.Schema.Author", null) .WithMany() - .HasForeignKey("AuthorId") + .HasForeignKey("AuthorsAuthorId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); @@ -681,7 +607,7 @@ namespace API.Migrations .IsRequired(); }); - modelBuilder.Entity("MangaTag", b => + modelBuilder.Entity("MangaMangaTag", b => { b.HasOne("API.Schema.Manga", null) .WithMany() @@ -691,37 +617,9 @@ namespace API.Migrations b.HasOne("API.Schema.MangaTag", null) .WithMany() - .HasForeignKey("MangaIds") + .HasForeignKey("TagsTag") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - - b.HasOne("API.Schema.MangaTag", null) - .WithMany() - .HasForeignKey("Tag") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("API.Schema.Jobs.CreateArchiveJob", b => - { - b.HasOne("API.Schema.Chapter", "Chapter") - .WithMany() - .HasForeignKey("ChapterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Chapter"); - }); - - modelBuilder.Entity("API.Schema.Jobs.CreateComicInfoXmlJob", b => - { - b.HasOne("API.Schema.Chapter", "Chapter") - .WithMany() - .HasForeignKey("ChapterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Chapter"); }); modelBuilder.Entity("API.Schema.Jobs.DownloadNewChaptersJob", b => @@ -766,15 +664,8 @@ namespace API.Migrations { b.Navigation("AltTitles"); - b.Navigation("Chapters"); - b.Navigation("Links"); }); - - modelBuilder.Entity("API.Schema.MangaConnector", b => - { - b.Navigation("Mangas"); - }); #pragma warning restore 612, 618 } } diff --git a/API/Migrations/20250303145324_dev-030325-2.cs b/API/Migrations/20250303145324_dev-030325-2.cs new file mode 100644 index 0000000..eb06ab4 --- /dev/null +++ b/API/Migrations/20250303145324_dev-030325-2.cs @@ -0,0 +1,34 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace API.Migrations +{ + /// + public partial class dev0303252 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "state", + table: "Jobs", + type: "smallint", + nullable: false, + oldClrType: typeof(int), + oldType: "integer"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "state", + table: "Jobs", + type: "integer", + nullable: false, + oldClrType: typeof(byte), + oldType: "smallint"); + } + } +} diff --git a/API/Migrations/20250303152212_dev-030325-3.Designer.cs b/API/Migrations/20250303152212_dev-030325-3.Designer.cs new file mode 100644 index 0000000..3c5b880 --- /dev/null +++ b/API/Migrations/20250303152212_dev-030325-3.Designer.cs @@ -0,0 +1,672 @@ +// +using System; +using API.Schema; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace API.Migrations +{ + [DbContext(typeof(PgsqlContext))] + [Migration("20250303152212_dev-030325-3")] + partial class dev0303253 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("API.Schema.Author", b => + { + b.Property("AuthorId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("AuthorName") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("AuthorId"); + + b.ToTable("Authors"); + }); + + modelBuilder.Entity("API.Schema.Chapter", b => + { + b.Property("ChapterId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ArchiveFileName") + .IsRequired() + .HasColumnType("text"); + + b.Property("ChapterNumber") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("Downloaded") + .HasColumnType("boolean"); + + b.Property("ParentMangaId") + .IsRequired() + .HasColumnType("character varying(64)"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.Property("VolumeNumber") + .HasColumnType("integer"); + + b.HasKey("ChapterId"); + + b.HasIndex("ParentMangaId"); + + b.ToTable("Chapters"); + }); + + modelBuilder.Entity("API.Schema.Jobs.Job", b => + { + b.Property("JobId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.PrimitiveCollection("DependsOnJobsIds") + .HasMaxLength(64) + .HasColumnType("text[]"); + + b.Property("JobId1") + .HasColumnType("character varying(64)"); + + b.Property("JobType") + .HasColumnType("smallint"); + + b.Property("LastExecution") + .HasColumnType("timestamp with time zone"); + + b.Property("ParentJobId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("RecurrenceMs") + .HasColumnType("numeric(20,0)"); + + b.Property("state") + .HasColumnType("smallint"); + + b.HasKey("JobId"); + + b.HasIndex("JobId1"); + + b.HasIndex("ParentJobId"); + + b.ToTable("Jobs"); + + b.HasDiscriminator("JobType"); + + b.UseTphMappingStrategy(); + }); + + modelBuilder.Entity("API.Schema.LibraryConnectors.LibraryConnector", b => + { + b.Property("LibraryConnectorId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Auth") + .IsRequired() + .HasColumnType("text"); + + b.Property("BaseUrl") + .IsRequired() + .HasColumnType("text"); + + b.Property("LibraryType") + .HasColumnType("smallint"); + + b.HasKey("LibraryConnectorId"); + + b.ToTable("LibraryConnectors"); + + b.HasDiscriminator("LibraryType"); + + b.UseTphMappingStrategy(); + }); + + modelBuilder.Entity("API.Schema.Link", b => + { + b.Property("LinkId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("LinkProvider") + .IsRequired() + .HasColumnType("text"); + + b.Property("LinkUrl") + .IsRequired() + .HasColumnType("text"); + + b.Property("MangaId") + .HasColumnType("character varying(64)"); + + b.HasKey("LinkId"); + + b.HasIndex("MangaId"); + + b.ToTable("Link"); + }); + + modelBuilder.Entity("API.Schema.Manga", b => + { + b.Property("MangaId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ConnectorId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("CoverFileNameInCache") + .HasColumnType("text"); + + b.Property("CoverUrl") + .IsRequired() + .HasColumnType("text"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("FolderName") + .IsRequired() + .HasColumnType("text"); + + b.Property("IgnoreChapterBefore") + .HasColumnType("real"); + + b.Property("MangaConnectorId") + .IsRequired() + .HasColumnType("character varying(32)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("OriginalLanguage") + .HasColumnType("text"); + + b.Property("ReleaseStatus") + .HasColumnType("smallint"); + + b.Property("WebsiteUrl") + .IsRequired() + .HasColumnType("text"); + + b.Property("Year") + .HasColumnType("bigint"); + + b.HasKey("MangaId"); + + b.HasIndex("MangaConnectorId"); + + b.ToTable("Manga"); + }); + + modelBuilder.Entity("API.Schema.MangaAltTitle", b => + { + b.Property("AltTitleId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Language") + .IsRequired() + .HasMaxLength(8) + .HasColumnType("character varying(8)"); + + b.Property("MangaId") + .HasColumnType("character varying(64)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("AltTitleId"); + + b.HasIndex("MangaId"); + + b.ToTable("AltTitles"); + }); + + modelBuilder.Entity("API.Schema.MangaConnectors.MangaConnector", b => + { + b.Property("Name") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.PrimitiveCollection("BaseUris") + .IsRequired() + .HasColumnType("text[]"); + + b.PrimitiveCollection("SupportedLanguages") + .IsRequired() + .HasColumnType("text[]"); + + b.HasKey("Name"); + + b.ToTable("MangaConnectors"); + + b.HasDiscriminator("Name").HasValue("MangaConnector"); + + b.UseTphMappingStrategy(); + }); + + modelBuilder.Entity("API.Schema.MangaTag", b => + { + b.Property("Tag") + .HasColumnType("text"); + + b.HasKey("Tag"); + + b.ToTable("Tags"); + }); + + modelBuilder.Entity("API.Schema.Notification", b => + { + b.Property("NotificationId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Date") + .HasColumnType("timestamp with time zone"); + + b.Property("Message") + .IsRequired() + .HasColumnType("text"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.Property("Urgency") + .HasColumnType("smallint"); + + b.HasKey("NotificationId"); + + b.ToTable("Notifications"); + }); + + modelBuilder.Entity("API.Schema.NotificationConnectors.NotificationConnector", b => + { + b.Property("NotificationConnectorId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("NotificationConnectorType") + .HasColumnType("smallint"); + + b.HasKey("NotificationConnectorId"); + + b.ToTable("NotificationConnectors"); + + b.HasDiscriminator("NotificationConnectorType"); + + b.UseTphMappingStrategy(); + }); + + modelBuilder.Entity("AuthorManga", b => + { + b.Property("AuthorsAuthorId") + .HasColumnType("character varying(64)"); + + b.Property("MangaId") + .HasColumnType("character varying(64)"); + + b.HasKey("AuthorsAuthorId", "MangaId"); + + b.HasIndex("MangaId"); + + b.ToTable("AuthorManga"); + }); + + modelBuilder.Entity("MangaMangaTag", b => + { + b.Property("MangaId") + .HasColumnType("character varying(64)"); + + b.Property("TagsTag") + .HasColumnType("text"); + + b.HasKey("MangaId", "TagsTag"); + + b.HasIndex("TagsTag"); + + b.ToTable("MangaMangaTag"); + }); + + modelBuilder.Entity("API.Schema.Jobs.DownloadNewChaptersJob", b => + { + b.HasBaseType("API.Schema.Jobs.Job"); + + b.Property("MangaId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.HasIndex("MangaId"); + + b.HasDiscriminator().HasValue((byte)1); + }); + + modelBuilder.Entity("API.Schema.Jobs.DownloadSingleChapterJob", b => + { + b.HasBaseType("API.Schema.Jobs.Job"); + + b.Property("ChapterId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.HasIndex("ChapterId"); + + b.HasDiscriminator().HasValue((byte)0); + }); + + modelBuilder.Entity("API.Schema.Jobs.MoveFileOrFolderJob", b => + { + b.HasBaseType("API.Schema.Jobs.Job"); + + b.Property("FromLocation") + .IsRequired() + .HasColumnType("text"); + + b.Property("ToLocation") + .IsRequired() + .HasColumnType("text"); + + b.HasDiscriminator().HasValue((byte)3); + }); + + modelBuilder.Entity("API.Schema.Jobs.UpdateMetadataJob", b => + { + b.HasBaseType("API.Schema.Jobs.Job"); + + b.Property("MangaId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.HasIndex("MangaId"); + + b.ToTable("Jobs", t => + { + t.Property("MangaId") + .HasColumnName("UpdateMetadataJob_MangaId"); + }); + + b.HasDiscriminator().HasValue((byte)2); + }); + + modelBuilder.Entity("API.Schema.LibraryConnectors.Kavita", b => + { + b.HasBaseType("API.Schema.LibraryConnectors.LibraryConnector"); + + b.HasDiscriminator().HasValue((byte)1); + }); + + modelBuilder.Entity("API.Schema.LibraryConnectors.Komga", b => + { + b.HasBaseType("API.Schema.LibraryConnectors.LibraryConnector"); + + b.HasDiscriminator().HasValue((byte)0); + }); + + modelBuilder.Entity("API.Schema.MangaConnectors.AsuraToon", b => + { + b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); + + b.HasDiscriminator().HasValue("AsuraToon"); + }); + + modelBuilder.Entity("API.Schema.MangaConnectors.Bato", b => + { + b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); + + b.HasDiscriminator().HasValue("Bato"); + }); + + modelBuilder.Entity("API.Schema.MangaConnectors.MangaDex", b => + { + b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); + + b.HasDiscriminator().HasValue("MangaDex"); + }); + + modelBuilder.Entity("API.Schema.MangaConnectors.MangaHere", b => + { + b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); + + b.HasDiscriminator().HasValue("MangaHere"); + }); + + modelBuilder.Entity("API.Schema.MangaConnectors.MangaKatana", b => + { + b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); + + b.HasDiscriminator().HasValue("MangaKatana"); + }); + + modelBuilder.Entity("API.Schema.MangaConnectors.Mangaworld", b => + { + b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); + + b.HasDiscriminator().HasValue("Mangaworld"); + }); + + modelBuilder.Entity("API.Schema.MangaConnectors.ManhuaPlus", b => + { + b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); + + b.HasDiscriminator().HasValue("ManhuaPlus"); + }); + + modelBuilder.Entity("API.Schema.MangaConnectors.Weebcentral", b => + { + b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); + + b.HasDiscriminator().HasValue("Weebcentral"); + }); + + modelBuilder.Entity("API.Schema.NotificationConnectors.Gotify", b => + { + b.HasBaseType("API.Schema.NotificationConnectors.NotificationConnector"); + + b.Property("AppToken") + .IsRequired() + .HasColumnType("text"); + + b.Property("Endpoint") + .IsRequired() + .HasColumnType("text"); + + b.HasDiscriminator().HasValue((byte)0); + }); + + modelBuilder.Entity("API.Schema.NotificationConnectors.Lunasea", b => + { + b.HasBaseType("API.Schema.NotificationConnectors.NotificationConnector"); + + b.Property("Id") + .IsRequired() + .HasColumnType("text"); + + b.HasDiscriminator().HasValue((byte)1); + }); + + modelBuilder.Entity("API.Schema.NotificationConnectors.Ntfy", b => + { + b.HasBaseType("API.Schema.NotificationConnectors.NotificationConnector"); + + b.Property("Auth") + .IsRequired() + .HasColumnType("text"); + + b.Property("Endpoint") + .IsRequired() + .HasColumnType("text"); + + b.Property("Topic") + .IsRequired() + .HasColumnType("text"); + + b.ToTable("NotificationConnectors", t => + { + t.Property("Endpoint") + .HasColumnName("Ntfy_Endpoint"); + }); + + b.HasDiscriminator().HasValue((byte)2); + }); + + modelBuilder.Entity("API.Schema.Chapter", b => + { + b.HasOne("API.Schema.Manga", "ParentManga") + .WithMany() + .HasForeignKey("ParentMangaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ParentManga"); + }); + + modelBuilder.Entity("API.Schema.Jobs.Job", b => + { + b.HasOne("API.Schema.Jobs.Job", null) + .WithMany("DependsOnJobs") + .HasForeignKey("JobId1"); + + b.HasOne("API.Schema.Jobs.Job", "ParentJob") + .WithMany() + .HasForeignKey("ParentJobId"); + + b.Navigation("ParentJob"); + }); + + modelBuilder.Entity("API.Schema.Link", b => + { + b.HasOne("API.Schema.Manga", null) + .WithMany("Links") + .HasForeignKey("MangaId"); + }); + + modelBuilder.Entity("API.Schema.Manga", b => + { + b.HasOne("API.Schema.MangaConnectors.MangaConnector", "MangaConnector") + .WithMany() + .HasForeignKey("MangaConnectorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MangaConnector"); + }); + + modelBuilder.Entity("API.Schema.MangaAltTitle", b => + { + b.HasOne("API.Schema.Manga", null) + .WithMany("AltTitles") + .HasForeignKey("MangaId"); + }); + + modelBuilder.Entity("AuthorManga", b => + { + b.HasOne("API.Schema.Author", null) + .WithMany() + .HasForeignKey("AuthorsAuthorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("API.Schema.Manga", null) + .WithMany() + .HasForeignKey("MangaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("MangaMangaTag", b => + { + b.HasOne("API.Schema.Manga", null) + .WithMany() + .HasForeignKey("MangaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("API.Schema.MangaTag", null) + .WithMany() + .HasForeignKey("TagsTag") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("API.Schema.Jobs.DownloadNewChaptersJob", b => + { + b.HasOne("API.Schema.Manga", "Manga") + .WithMany() + .HasForeignKey("MangaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Manga"); + }); + + modelBuilder.Entity("API.Schema.Jobs.DownloadSingleChapterJob", b => + { + b.HasOne("API.Schema.Chapter", "Chapter") + .WithMany() + .HasForeignKey("ChapterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Chapter"); + }); + + modelBuilder.Entity("API.Schema.Jobs.UpdateMetadataJob", b => + { + b.HasOne("API.Schema.Manga", "Manga") + .WithMany() + .HasForeignKey("MangaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Manga"); + }); + + modelBuilder.Entity("API.Schema.Jobs.Job", b => + { + b.Navigation("DependsOnJobs"); + }); + + modelBuilder.Entity("API.Schema.Manga", b => + { + b.Navigation("AltTitles"); + + b.Navigation("Links"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/API/Migrations/20250303152212_dev-030325-3.cs b/API/Migrations/20250303152212_dev-030325-3.cs new file mode 100644 index 0000000..1490e66 --- /dev/null +++ b/API/Migrations/20250303152212_dev-030325-3.cs @@ -0,0 +1,22 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace API.Migrations +{ + /// + public partial class dev0303253 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/API/Migrations/PgsqlContextModelSnapshot.cs b/API/Migrations/PgsqlContextModelSnapshot.cs index a0499ab..0d6d218 100644 --- a/API/Migrations/PgsqlContextModelSnapshot.cs +++ b/API/Migrations/PgsqlContextModelSnapshot.cs @@ -102,8 +102,8 @@ namespace API.Migrations b.Property("RecurrenceMs") .HasColumnType("numeric(20,0)"); - b.Property("state") - .HasColumnType("integer"); + b.Property("state") + .HasColumnType("smallint"); b.HasKey("JobId"); @@ -468,27 +468,6 @@ namespace API.Migrations b.HasDiscriminator().HasValue("MangaKatana"); }); - modelBuilder.Entity("API.Schema.MangaConnectors.MangaLife", b => - { - b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); - - b.HasDiscriminator().HasValue("Manga4Life"); - }); - - modelBuilder.Entity("API.Schema.MangaConnectors.Manganato", b => - { - b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); - - b.HasDiscriminator().HasValue("Manganato"); - }); - - modelBuilder.Entity("API.Schema.MangaConnectors.Mangasee", b => - { - b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); - - b.HasDiscriminator().HasValue("Mangasee"); - }); - modelBuilder.Entity("API.Schema.MangaConnectors.Mangaworld", b => { b.HasBaseType("API.Schema.MangaConnectors.MangaConnector");