From 4b4e24c6a0f4e375fa8444dc3aaa0b151591e8aa Mon Sep 17 00:00:00 2001 From: Glax Date: Thu, 15 May 2025 15:14:09 +0200 Subject: [PATCH] Migrations update --- .../20250509033915_Initial.Designer.cs | 786 ------------------ .../20250509034207_Initial-2.Designer.cs | 786 ------------------ API/Migrations/20250509034207_Initial-2.cs | 22 - .../20250509035413_Initial-3.Designer.cs | 786 ------------------ API/Migrations/20250509035413_Initial-3.cs | 130 --- .../20250509035606_Initial-4.Designer.cs | 784 ----------------- API/Migrations/20250509035606_Initial-4.cs | 40 - API/Migrations/20250509035754_Initial-5.cs | 40 - .../20250515120732_Initial.Designer.cs | 71 ++ .../library/20250515120732_Initial.cs | 35 + .../library/LibraryContextModelSnapshot.cs | 68 ++ .../20250515120746_Initial.Designer.cs | 89 ++ .../notifications/20250515120746_Initial.cs | 59 ++ .../NotificationsContextModelSnapshot.cs | 86 ++ .../20250515120724_Initial-1.Designer.cs} | 109 +-- .../20250515120724_Initial-1.cs} | 129 +-- .../{ => pgsql}/PgsqlContextModelSnapshot.cs | 105 +-- 17 files changed, 450 insertions(+), 3675 deletions(-) delete mode 100644 API/Migrations/20250509033915_Initial.Designer.cs delete mode 100644 API/Migrations/20250509034207_Initial-2.Designer.cs delete mode 100644 API/Migrations/20250509034207_Initial-2.cs delete mode 100644 API/Migrations/20250509035413_Initial-3.Designer.cs delete mode 100644 API/Migrations/20250509035413_Initial-3.cs delete mode 100644 API/Migrations/20250509035606_Initial-4.Designer.cs delete mode 100644 API/Migrations/20250509035606_Initial-4.cs delete mode 100644 API/Migrations/20250509035754_Initial-5.cs create mode 100644 API/Migrations/library/20250515120732_Initial.Designer.cs create mode 100644 API/Migrations/library/20250515120732_Initial.cs create mode 100644 API/Migrations/library/LibraryContextModelSnapshot.cs create mode 100644 API/Migrations/notifications/20250515120746_Initial.Designer.cs create mode 100644 API/Migrations/notifications/20250515120746_Initial.cs create mode 100644 API/Migrations/notifications/NotificationsContextModelSnapshot.cs rename API/Migrations/{20250509035754_Initial-5.Designer.cs => pgsql/20250515120724_Initial-1.Designer.cs} (86%) rename API/Migrations/{20250509033915_Initial.cs => pgsql/20250515120724_Initial-1.cs} (84%) rename API/Migrations/{ => pgsql}/PgsqlContextModelSnapshot.cs (86%) diff --git a/API/Migrations/20250509033915_Initial.Designer.cs b/API/Migrations/20250509033915_Initial.Designer.cs deleted file mode 100644 index 0979c82..0000000 --- a/API/Migrations/20250509033915_Initial.Designer.cs +++ /dev/null @@ -1,786 +0,0 @@ -// -using System; -using System.Collections.Generic; -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("20250509033915_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "hstore"); - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("API.Schema.Author", b => - { - b.Property("AuthorId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("AuthorName") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.HasKey("AuthorId"); - - b.ToTable("Authors"); - }); - - modelBuilder.Entity("API.Schema.Chapter", b => - { - b.Property("ChapterId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ChapterNumber") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Downloaded") - .HasColumnType("boolean"); - - b.Property("FileName") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("ParentMangaId") - .IsRequired() - .HasColumnType("character varying(64)"); - - b.Property("Title") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("Url") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - 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.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("JobType") - .HasColumnType("smallint"); - - b.Property("LastExecution") - .HasColumnType("timestamp with time zone"); - - b.Property("ParentJobId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("RecurrenceMs") - .HasColumnType("numeric(20,0)"); - - b.Property("state") - .HasColumnType("smallint"); - - b.HasKey("JobId"); - - 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() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("BaseUrl") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("LibraryType") - .HasColumnType("smallint"); - - b.HasKey("LibraryConnectorId"); - - b.ToTable("LibraryConnectors"); - - b.HasDiscriminator("LibraryType"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("API.Schema.LocalLibrary", b => - { - b.Property("LocalLibraryId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("BasePath") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("LibraryName") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.HasKey("LocalLibraryId"); - - b.ToTable("LocalLibraries"); - }); - - modelBuilder.Entity("API.Schema.Manga", b => - { - b.Property("MangaId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CoverFileNameInCache") - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("CoverUrl") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("DirectoryName") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)"); - - b.Property("IdOnConnectorSite") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("IgnoreChaptersBefore") - .HasColumnType("real"); - - b.Property("LibraryId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("MangaConnectorName") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("OriginalLanguage") - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b.Property("ReleaseStatus") - .HasColumnType("smallint"); - - b.Property("WebsiteUrl") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("Year") - .HasColumnType("bigint"); - - b.HasKey("MangaId"); - - b.HasIndex("LibraryId"); - - b.HasIndex("MangaConnectorName"); - - b.ToTable("Mangas"); - }); - - modelBuilder.Entity("API.Schema.MangaConnectors.MangaConnector", b => - { - b.Property("Name") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.PrimitiveCollection("BaseUris") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("text[]"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("IconUrl") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b.PrimitiveCollection("SupportedLanguages") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("text[]"); - - b.HasKey("Name"); - - b.ToTable("MangaConnectors"); - - b.HasDiscriminator("Name").HasValue("MangaConnector"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("API.Schema.MangaTag", b => - { - b.Property("Tag") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - 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() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("Urgency") - .HasColumnType("smallint"); - - b.HasKey("NotificationId"); - - b.ToTable("Notifications"); - }); - - modelBuilder.Entity("API.Schema.NotificationConnectors.NotificationConnector", b => - { - b.Property("Name") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Body") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)"); - - b.Property>("Headers") - .IsRequired() - .HasColumnType("hstore"); - - b.Property("HttpMethod") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b.Property("Url") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b.HasKey("Name"); - - b.ToTable("NotificationConnectors"); - }); - - modelBuilder.Entity("AuthorToManga", b => - { - b.Property("AuthorIds") - .HasColumnType("character varying(64)"); - - b.Property("MangaIds") - .HasColumnType("character varying(64)"); - - b.HasKey("AuthorIds", "MangaIds"); - - b.HasIndex("MangaIds"); - - b.ToTable("AuthorToManga"); - }); - - modelBuilder.Entity("JobJob", b => - { - b.Property("DependsOnJobsJobId") - .HasColumnType("character varying(64)"); - - b.Property("JobId") - .HasColumnType("character varying(64)"); - - b.HasKey("DependsOnJobsJobId", "JobId"); - - b.HasIndex("JobId"); - - b.ToTable("JobJob"); - }); - - modelBuilder.Entity("MangaTagToManga", b => - { - b.Property("MangaTagIds") - .HasColumnType("character varying(64)"); - - b.Property("MangaIds") - .HasColumnType("character varying(64)"); - - b.HasKey("MangaTagIds", "MangaIds"); - - b.HasIndex("MangaIds"); - - b.ToTable("MangaTagToManga"); - }); - - modelBuilder.Entity("API.Schema.Jobs.DownloadAvailableChaptersJob", 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("DownloadAvailableChaptersJob_MangaId"); - }); - - b.HasDiscriminator().HasValue((byte)1); - }); - - modelBuilder.Entity("API.Schema.Jobs.DownloadMangaCoverJob", b => - { - b.HasBaseType("API.Schema.Jobs.Job"); - - b.Property("MangaId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasIndex("MangaId"); - - b.HasDiscriminator().HasValue((byte)4); - }); - - 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() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("ToLocation") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.HasDiscriminator().HasValue((byte)3); - }); - - modelBuilder.Entity("API.Schema.Jobs.MoveMangaLibraryJob", b => - { - b.HasBaseType("API.Schema.Jobs.Job"); - - b.Property("MangaId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ToLibraryId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasIndex("MangaId"); - - b.HasIndex("ToLibraryId"); - - b.ToTable("Jobs", t => - { - t.Property("MangaId") - .HasColumnName("MoveMangaLibraryJob_MangaId"); - }); - - b.HasDiscriminator().HasValue((byte)7); - }); - - modelBuilder.Entity("API.Schema.Jobs.RetrieveChaptersJob", b => - { - b.HasBaseType("API.Schema.Jobs.Job"); - - b.Property("Language") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b.Property("MangaId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasIndex("MangaId"); - - b.ToTable("Jobs", t => - { - t.Property("MangaId") - .HasColumnName("RetrieveChaptersJob_MangaId"); - }); - - b.HasDiscriminator().HasValue((byte)5); - }); - - modelBuilder.Entity("API.Schema.Jobs.UpdateFilesDownloadedJob", 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("UpdateFilesDownloadedJob_MangaId"); - }); - - b.HasDiscriminator().HasValue((byte)6); - }); - - 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.Global", b => - { - b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); - - b.HasDiscriminator().HasValue("Global"); - }); - - modelBuilder.Entity("API.Schema.MangaConnectors.MangaDex", b => - { - b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); - - b.HasDiscriminator().HasValue("MangaDex"); - }); - - modelBuilder.Entity("API.Schema.Chapter", b => - { - b.HasOne("API.Schema.Manga", "ParentManga") - .WithMany("Chapters") - .HasForeignKey("ParentMangaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ParentManga"); - }); - - modelBuilder.Entity("API.Schema.Jobs.Job", b => - { - b.HasOne("API.Schema.Jobs.Job", "ParentJob") - .WithMany() - .HasForeignKey("ParentJobId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("ParentJob"); - }); - - modelBuilder.Entity("API.Schema.Manga", b => - { - b.HasOne("API.Schema.LocalLibrary", "Library") - .WithMany() - .HasForeignKey("LibraryId") - .OnDelete(DeleteBehavior.SetNull) - .IsRequired(); - - b.HasOne("API.Schema.MangaConnectors.MangaConnector", "MangaConnector") - .WithMany() - .HasForeignKey("MangaConnectorName") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("API.Schema.Link", "Links", b1 => - { - b1.Property("LinkId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("LinkProvider") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("LinkUrl") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b1.Property("MangaId") - .IsRequired() - .HasColumnType("character varying(64)"); - - b1.HasKey("LinkId"); - - b1.HasIndex("MangaId"); - - b1.ToTable("Links"); - - b1.WithOwner() - .HasForeignKey("MangaId"); - }); - - b.OwnsMany("API.Schema.MangaAltTitle", "AltTitles", b1 => - { - b1.Property("AltTitleId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Language") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b1.Property("MangaId") - .IsRequired() - .HasColumnType("character varying(64)"); - - b1.Property("Title") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b1.HasKey("AltTitleId"); - - b1.HasIndex("MangaId"); - - b1.ToTable("AltTitles"); - - b1.WithOwner() - .HasForeignKey("MangaId"); - }); - - b.Navigation("AltTitles"); - - b.Navigation("Library"); - - b.Navigation("Links"); - - b.Navigation("MangaConnector"); - }); - - modelBuilder.Entity("AuthorToManga", b => - { - b.HasOne("API.Schema.Author", null) - .WithMany() - .HasForeignKey("AuthorIds") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("API.Schema.Manga", null) - .WithMany() - .HasForeignKey("MangaIds") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("JobJob", b => - { - b.HasOne("API.Schema.Jobs.Job", null) - .WithMany() - .HasForeignKey("DependsOnJobsJobId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("API.Schema.Jobs.Job", null) - .WithMany() - .HasForeignKey("JobId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("MangaTagToManga", b => - { - b.HasOne("API.Schema.Manga", null) - .WithMany() - .HasForeignKey("MangaIds") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("API.Schema.MangaTag", null) - .WithMany() - .HasForeignKey("MangaTagIds") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("API.Schema.Jobs.DownloadAvailableChaptersJob", b => - { - b.HasOne("API.Schema.Manga", "Manga") - .WithMany() - .HasForeignKey("MangaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Manga"); - }); - - modelBuilder.Entity("API.Schema.Jobs.DownloadMangaCoverJob", 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.MoveMangaLibraryJob", b => - { - b.HasOne("API.Schema.Manga", "Manga") - .WithMany() - .HasForeignKey("MangaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("API.Schema.LocalLibrary", "ToLibrary") - .WithMany() - .HasForeignKey("ToLibraryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Manga"); - - b.Navigation("ToLibrary"); - }); - - modelBuilder.Entity("API.Schema.Jobs.RetrieveChaptersJob", b => - { - b.HasOne("API.Schema.Manga", "Manga") - .WithMany() - .HasForeignKey("MangaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Manga"); - }); - - modelBuilder.Entity("API.Schema.Jobs.UpdateFilesDownloadedJob", b => - { - b.HasOne("API.Schema.Manga", "Manga") - .WithMany() - .HasForeignKey("MangaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Manga"); - }); - - modelBuilder.Entity("API.Schema.Manga", b => - { - b.Navigation("Chapters"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/API/Migrations/20250509034207_Initial-2.Designer.cs b/API/Migrations/20250509034207_Initial-2.Designer.cs deleted file mode 100644 index e73b2c8..0000000 --- a/API/Migrations/20250509034207_Initial-2.Designer.cs +++ /dev/null @@ -1,786 +0,0 @@ -// -using System; -using System.Collections.Generic; -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("20250509034207_Initial-2")] - partial class Initial2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "hstore"); - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("API.Schema.Author", b => - { - b.Property("AuthorId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("AuthorName") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.HasKey("AuthorId"); - - b.ToTable("Authors"); - }); - - modelBuilder.Entity("API.Schema.Chapter", b => - { - b.Property("ChapterId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ChapterNumber") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Downloaded") - .HasColumnType("boolean"); - - b.Property("FileName") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("ParentMangaId") - .IsRequired() - .HasColumnType("character varying(64)"); - - b.Property("Title") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("Url") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - 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.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("JobType") - .HasColumnType("smallint"); - - b.Property("LastExecution") - .HasColumnType("timestamp with time zone"); - - b.Property("ParentJobId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("RecurrenceMs") - .HasColumnType("numeric(20,0)"); - - b.Property("state") - .HasColumnType("smallint"); - - b.HasKey("JobId"); - - 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() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("BaseUrl") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("LibraryType") - .HasColumnType("smallint"); - - b.HasKey("LibraryConnectorId"); - - b.ToTable("LibraryConnectors"); - - b.HasDiscriminator("LibraryType"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("API.Schema.LocalLibrary", b => - { - b.Property("LocalLibraryId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("BasePath") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("LibraryName") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.HasKey("LocalLibraryId"); - - b.ToTable("LocalLibraries"); - }); - - modelBuilder.Entity("API.Schema.Manga", b => - { - b.Property("MangaId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CoverFileNameInCache") - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("CoverUrl") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("DirectoryName") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)"); - - b.Property("IdOnConnectorSite") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("IgnoreChaptersBefore") - .HasColumnType("real"); - - b.Property("LibraryId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("MangaConnectorName") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("OriginalLanguage") - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b.Property("ReleaseStatus") - .HasColumnType("smallint"); - - b.Property("WebsiteUrl") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("Year") - .HasColumnType("bigint"); - - b.HasKey("MangaId"); - - b.HasIndex("LibraryId"); - - b.HasIndex("MangaConnectorName"); - - b.ToTable("Mangas"); - }); - - modelBuilder.Entity("API.Schema.MangaConnectors.MangaConnector", b => - { - b.Property("Name") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.PrimitiveCollection("BaseUris") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("text[]"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("IconUrl") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b.PrimitiveCollection("SupportedLanguages") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("text[]"); - - b.HasKey("Name"); - - b.ToTable("MangaConnectors"); - - b.HasDiscriminator("Name").HasValue("MangaConnector"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("API.Schema.MangaTag", b => - { - b.Property("Tag") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - 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() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("Urgency") - .HasColumnType("smallint"); - - b.HasKey("NotificationId"); - - b.ToTable("Notifications"); - }); - - modelBuilder.Entity("API.Schema.NotificationConnectors.NotificationConnector", b => - { - b.Property("Name") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Body") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)"); - - b.Property>("Headers") - .IsRequired() - .HasColumnType("hstore"); - - b.Property("HttpMethod") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b.Property("Url") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b.HasKey("Name"); - - b.ToTable("NotificationConnectors"); - }); - - modelBuilder.Entity("AuthorToManga", b => - { - b.Property("AuthorIds") - .HasColumnType("character varying(64)"); - - b.Property("MangaIds") - .HasColumnType("character varying(64)"); - - b.HasKey("AuthorIds", "MangaIds"); - - b.HasIndex("MangaIds"); - - b.ToTable("AuthorToManga"); - }); - - modelBuilder.Entity("JobJob", b => - { - b.Property("DependsOnJobsJobId") - .HasColumnType("character varying(64)"); - - b.Property("JobId") - .HasColumnType("character varying(64)"); - - b.HasKey("DependsOnJobsJobId", "JobId"); - - b.HasIndex("JobId"); - - b.ToTable("JobJob"); - }); - - modelBuilder.Entity("MangaTagToManga", b => - { - b.Property("MangaTagIds") - .HasColumnType("character varying(64)"); - - b.Property("MangaIds") - .HasColumnType("character varying(64)"); - - b.HasKey("MangaTagIds", "MangaIds"); - - b.HasIndex("MangaIds"); - - b.ToTable("MangaTagToManga"); - }); - - modelBuilder.Entity("API.Schema.Jobs.DownloadAvailableChaptersJob", 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("DownloadAvailableChaptersJob_MangaId"); - }); - - b.HasDiscriminator().HasValue((byte)1); - }); - - modelBuilder.Entity("API.Schema.Jobs.DownloadMangaCoverJob", b => - { - b.HasBaseType("API.Schema.Jobs.Job"); - - b.Property("MangaId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasIndex("MangaId"); - - b.HasDiscriminator().HasValue((byte)4); - }); - - 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() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("ToLocation") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.HasDiscriminator().HasValue((byte)3); - }); - - modelBuilder.Entity("API.Schema.Jobs.MoveMangaLibraryJob", b => - { - b.HasBaseType("API.Schema.Jobs.Job"); - - b.Property("MangaId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ToLibraryId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasIndex("MangaId"); - - b.HasIndex("ToLibraryId"); - - b.ToTable("Jobs", t => - { - t.Property("MangaId") - .HasColumnName("MoveMangaLibraryJob_MangaId"); - }); - - b.HasDiscriminator().HasValue((byte)7); - }); - - modelBuilder.Entity("API.Schema.Jobs.RetrieveChaptersJob", b => - { - b.HasBaseType("API.Schema.Jobs.Job"); - - b.Property("Language") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b.Property("MangaId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasIndex("MangaId"); - - b.ToTable("Jobs", t => - { - t.Property("MangaId") - .HasColumnName("RetrieveChaptersJob_MangaId"); - }); - - b.HasDiscriminator().HasValue((byte)5); - }); - - modelBuilder.Entity("API.Schema.Jobs.UpdateFilesDownloadedJob", 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("UpdateFilesDownloadedJob_MangaId"); - }); - - b.HasDiscriminator().HasValue((byte)6); - }); - - 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.Global", b => - { - b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); - - b.HasDiscriminator().HasValue("Global"); - }); - - modelBuilder.Entity("API.Schema.MangaConnectors.MangaDex", b => - { - b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); - - b.HasDiscriminator().HasValue("MangaDex"); - }); - - modelBuilder.Entity("API.Schema.Chapter", b => - { - b.HasOne("API.Schema.Manga", "ParentManga") - .WithMany("Chapters") - .HasForeignKey("ParentMangaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ParentManga"); - }); - - modelBuilder.Entity("API.Schema.Jobs.Job", b => - { - b.HasOne("API.Schema.Jobs.Job", "ParentJob") - .WithMany() - .HasForeignKey("ParentJobId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("ParentJob"); - }); - - modelBuilder.Entity("API.Schema.Manga", b => - { - b.HasOne("API.Schema.LocalLibrary", "Library") - .WithMany() - .HasForeignKey("LibraryId") - .OnDelete(DeleteBehavior.SetNull) - .IsRequired(); - - b.HasOne("API.Schema.MangaConnectors.MangaConnector", "MangaConnector") - .WithMany() - .HasForeignKey("MangaConnectorName") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("API.Schema.Link", "Links", b1 => - { - b1.Property("LinkId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("LinkProvider") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("LinkUrl") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b1.Property("MangaId") - .IsRequired() - .HasColumnType("character varying(64)"); - - b1.HasKey("LinkId"); - - b1.HasIndex("MangaId"); - - b1.ToTable("Links"); - - b1.WithOwner() - .HasForeignKey("MangaId"); - }); - - b.OwnsMany("API.Schema.MangaAltTitle", "AltTitles", b1 => - { - b1.Property("AltTitleId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Language") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b1.Property("MangaId") - .IsRequired() - .HasColumnType("character varying(64)"); - - b1.Property("Title") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b1.HasKey("AltTitleId"); - - b1.HasIndex("MangaId"); - - b1.ToTable("AltTitles"); - - b1.WithOwner() - .HasForeignKey("MangaId"); - }); - - b.Navigation("AltTitles"); - - b.Navigation("Library"); - - b.Navigation("Links"); - - b.Navigation("MangaConnector"); - }); - - modelBuilder.Entity("AuthorToManga", b => - { - b.HasOne("API.Schema.Author", null) - .WithMany() - .HasForeignKey("AuthorIds") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("API.Schema.Manga", null) - .WithMany() - .HasForeignKey("MangaIds") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("JobJob", b => - { - b.HasOne("API.Schema.Jobs.Job", null) - .WithMany() - .HasForeignKey("DependsOnJobsJobId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("API.Schema.Jobs.Job", null) - .WithMany() - .HasForeignKey("JobId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("MangaTagToManga", b => - { - b.HasOne("API.Schema.Manga", null) - .WithMany() - .HasForeignKey("MangaIds") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("API.Schema.MangaTag", null) - .WithMany() - .HasForeignKey("MangaTagIds") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("API.Schema.Jobs.DownloadAvailableChaptersJob", b => - { - b.HasOne("API.Schema.Manga", "Manga") - .WithMany() - .HasForeignKey("MangaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Manga"); - }); - - modelBuilder.Entity("API.Schema.Jobs.DownloadMangaCoverJob", 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.MoveMangaLibraryJob", b => - { - b.HasOne("API.Schema.Manga", "Manga") - .WithMany() - .HasForeignKey("MangaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("API.Schema.LocalLibrary", "ToLibrary") - .WithMany() - .HasForeignKey("ToLibraryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Manga"); - - b.Navigation("ToLibrary"); - }); - - modelBuilder.Entity("API.Schema.Jobs.RetrieveChaptersJob", b => - { - b.HasOne("API.Schema.Manga", "Manga") - .WithMany() - .HasForeignKey("MangaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Manga"); - }); - - modelBuilder.Entity("API.Schema.Jobs.UpdateFilesDownloadedJob", b => - { - b.HasOne("API.Schema.Manga", "Manga") - .WithMany() - .HasForeignKey("MangaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Manga"); - }); - - modelBuilder.Entity("API.Schema.Manga", b => - { - b.Navigation("Chapters"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/API/Migrations/20250509034207_Initial-2.cs b/API/Migrations/20250509034207_Initial-2.cs deleted file mode 100644 index b14848f..0000000 --- a/API/Migrations/20250509034207_Initial-2.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace API.Migrations -{ - /// - public partial class Initial2 : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/API/Migrations/20250509035413_Initial-3.Designer.cs b/API/Migrations/20250509035413_Initial-3.Designer.cs deleted file mode 100644 index 453ec1b..0000000 --- a/API/Migrations/20250509035413_Initial-3.Designer.cs +++ /dev/null @@ -1,786 +0,0 @@ -// -using System; -using System.Collections.Generic; -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("20250509035413_Initial-3")] - partial class Initial3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "hstore"); - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("API.Schema.Author", b => - { - b.Property("AuthorId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("AuthorName") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.HasKey("AuthorId"); - - b.ToTable("Authors"); - }); - - modelBuilder.Entity("API.Schema.Chapter", b => - { - b.Property("ChapterId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ChapterNumber") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Downloaded") - .HasColumnType("boolean"); - - b.Property("FileName") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("ParentMangaId") - .IsRequired() - .HasColumnType("character varying(64)"); - - b.Property("Title") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("Url") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - 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.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("JobType") - .HasColumnType("smallint"); - - b.Property("LastExecution") - .HasColumnType("timestamp with time zone"); - - b.Property("ParentJobId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("RecurrenceMs") - .HasColumnType("numeric(20,0)"); - - b.Property("state") - .HasColumnType("smallint"); - - b.HasKey("JobId"); - - 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() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("BaseUrl") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("LibraryType") - .HasColumnType("smallint"); - - b.HasKey("LibraryConnectorId"); - - b.ToTable("LibraryConnectors"); - - b.HasDiscriminator("LibraryType"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("API.Schema.LocalLibrary", b => - { - b.Property("LocalLibraryId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("BasePath") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("LibraryName") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.HasKey("LocalLibraryId"); - - b.ToTable("LocalLibraries"); - }); - - modelBuilder.Entity("API.Schema.Manga", b => - { - b.Property("MangaId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CoverFileNameInCache") - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("CoverUrl") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("DirectoryName") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)"); - - b.Property("IdOnConnectorSite") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("IgnoreChaptersBefore") - .HasColumnType("real"); - - b.Property("LibraryId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("MangaConnectorName") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("OriginalLanguage") - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b.Property("ReleaseStatus") - .HasColumnType("smallint"); - - b.Property("WebsiteUrl") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("Year") - .HasColumnType("bigint"); - - b.HasKey("MangaId"); - - b.HasIndex("LibraryId"); - - b.HasIndex("MangaConnectorName"); - - b.ToTable("Mangas"); - }); - - modelBuilder.Entity("API.Schema.MangaConnectors.MangaConnector", b => - { - b.Property("Name") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.PrimitiveCollection("BaseUris") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("text[]"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("IconUrl") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b.PrimitiveCollection("SupportedLanguages") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("text[]"); - - b.HasKey("Name"); - - b.ToTable("MangaConnectors"); - - b.HasDiscriminator("Name").HasValue("MangaConnector"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("API.Schema.MangaTag", b => - { - b.Property("Tag") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - 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() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("Urgency") - .HasColumnType("smallint"); - - b.HasKey("NotificationId"); - - b.ToTable("Notifications"); - }); - - modelBuilder.Entity("API.Schema.NotificationConnectors.NotificationConnector", b => - { - b.Property("Name") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Body") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)"); - - b.Property>("Headers") - .IsRequired() - .HasColumnType("hstore"); - - b.Property("HttpMethod") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b.Property("Url") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b.HasKey("Name"); - - b.ToTable("NotificationConnectors"); - }); - - modelBuilder.Entity("AuthorToManga", b => - { - b.Property("AuthorIds") - .HasColumnType("character varying(64)"); - - b.Property("MangaIds") - .HasColumnType("character varying(64)"); - - b.HasKey("AuthorIds", "MangaIds"); - - b.HasIndex("MangaIds"); - - b.ToTable("AuthorToManga"); - }); - - modelBuilder.Entity("JobJob", b => - { - b.Property("DependsOnJobsJobId") - .HasColumnType("character varying(64)"); - - b.Property("JobId") - .HasColumnType("character varying(64)"); - - b.HasKey("DependsOnJobsJobId", "JobId"); - - b.HasIndex("JobId"); - - b.ToTable("JobJob"); - }); - - modelBuilder.Entity("MangaTagToManga", b => - { - b.Property("MangaTagIds") - .HasColumnType("character varying(64)"); - - b.Property("MangaIds") - .HasColumnType("character varying(64)"); - - b.HasKey("MangaTagIds", "MangaIds"); - - b.HasIndex("MangaIds"); - - b.ToTable("MangaTagToManga"); - }); - - modelBuilder.Entity("API.Schema.Jobs.DownloadAvailableChaptersJob", 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("DownloadAvailableChaptersJob_MangaId"); - }); - - b.HasDiscriminator().HasValue((byte)1); - }); - - modelBuilder.Entity("API.Schema.Jobs.DownloadMangaCoverJob", b => - { - b.HasBaseType("API.Schema.Jobs.Job"); - - b.Property("MangaId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasIndex("MangaId"); - - b.HasDiscriminator().HasValue((byte)4); - }); - - 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() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("ToLocation") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.HasDiscriminator().HasValue((byte)3); - }); - - modelBuilder.Entity("API.Schema.Jobs.MoveMangaLibraryJob", b => - { - b.HasBaseType("API.Schema.Jobs.Job"); - - b.Property("MangaId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ToLibraryId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasIndex("MangaId"); - - b.HasIndex("ToLibraryId"); - - b.ToTable("Jobs", t => - { - t.Property("MangaId") - .HasColumnName("MoveMangaLibraryJob_MangaId"); - }); - - b.HasDiscriminator().HasValue((byte)7); - }); - - modelBuilder.Entity("API.Schema.Jobs.RetrieveChaptersJob", b => - { - b.HasBaseType("API.Schema.Jobs.Job"); - - b.Property("Language") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b.Property("MangaId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasIndex("MangaId"); - - b.ToTable("Jobs", t => - { - t.Property("MangaId") - .HasColumnName("RetrieveChaptersJob_MangaId"); - }); - - b.HasDiscriminator().HasValue((byte)5); - }); - - modelBuilder.Entity("API.Schema.Jobs.UpdateFilesDownloadedJob", 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("UpdateFilesDownloadedJob_MangaId"); - }); - - b.HasDiscriminator().HasValue((byte)6); - }); - - 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.Global", b => - { - b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); - - b.HasDiscriminator().HasValue("Global"); - }); - - modelBuilder.Entity("API.Schema.MangaConnectors.MangaDex", b => - { - b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); - - b.HasDiscriminator().HasValue("MangaDex"); - }); - - modelBuilder.Entity("API.Schema.Chapter", b => - { - b.HasOne("API.Schema.Manga", "ParentManga") - .WithMany("Chapters") - .HasForeignKey("ParentMangaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ParentManga"); - }); - - modelBuilder.Entity("API.Schema.Jobs.Job", b => - { - b.HasOne("API.Schema.Jobs.Job", "ParentJob") - .WithMany() - .HasForeignKey("ParentJobId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("ParentJob"); - }); - - modelBuilder.Entity("API.Schema.Manga", b => - { - b.HasOne("API.Schema.LocalLibrary", "Library") - .WithMany() - .HasForeignKey("LibraryId") - .OnDelete(DeleteBehavior.SetNull) - .IsRequired(); - - b.HasOne("API.Schema.MangaConnectors.MangaConnector", "MangaConnector") - .WithMany() - .HasForeignKey("MangaConnectorName") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("API.Schema.Link", "Links", b1 => - { - b1.Property("LinkId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("LinkProvider") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("LinkUrl") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b1.Property("MangaId") - .IsRequired() - .HasColumnType("character varying(64)"); - - b1.HasKey("LinkId"); - - b1.HasIndex("MangaId"); - - b1.ToTable("Link"); - - b1.WithOwner() - .HasForeignKey("MangaId"); - }); - - b.OwnsMany("API.Schema.MangaAltTitle", "AltTitles", b1 => - { - b1.Property("AltTitleId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Language") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b1.Property("MangaId") - .IsRequired() - .HasColumnType("character varying(64)"); - - b1.Property("Title") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b1.HasKey("AltTitleId"); - - b1.HasIndex("MangaId"); - - b1.ToTable("MangaAltTitle"); - - b1.WithOwner() - .HasForeignKey("MangaId"); - }); - - b.Navigation("AltTitles"); - - b.Navigation("Library"); - - b.Navigation("Links"); - - b.Navigation("MangaConnector"); - }); - - modelBuilder.Entity("AuthorToManga", b => - { - b.HasOne("API.Schema.Author", null) - .WithMany() - .HasForeignKey("AuthorIds") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("API.Schema.Manga", null) - .WithMany() - .HasForeignKey("MangaIds") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("JobJob", b => - { - b.HasOne("API.Schema.Jobs.Job", null) - .WithMany() - .HasForeignKey("DependsOnJobsJobId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("API.Schema.Jobs.Job", null) - .WithMany() - .HasForeignKey("JobId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("MangaTagToManga", b => - { - b.HasOne("API.Schema.Manga", null) - .WithMany() - .HasForeignKey("MangaIds") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("API.Schema.MangaTag", null) - .WithMany() - .HasForeignKey("MangaTagIds") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("API.Schema.Jobs.DownloadAvailableChaptersJob", b => - { - b.HasOne("API.Schema.Manga", "Manga") - .WithMany() - .HasForeignKey("MangaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Manga"); - }); - - modelBuilder.Entity("API.Schema.Jobs.DownloadMangaCoverJob", 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.MoveMangaLibraryJob", b => - { - b.HasOne("API.Schema.Manga", "Manga") - .WithMany() - .HasForeignKey("MangaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("API.Schema.LocalLibrary", "ToLibrary") - .WithMany() - .HasForeignKey("ToLibraryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Manga"); - - b.Navigation("ToLibrary"); - }); - - modelBuilder.Entity("API.Schema.Jobs.RetrieveChaptersJob", b => - { - b.HasOne("API.Schema.Manga", "Manga") - .WithMany() - .HasForeignKey("MangaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Manga"); - }); - - modelBuilder.Entity("API.Schema.Jobs.UpdateFilesDownloadedJob", b => - { - b.HasOne("API.Schema.Manga", "Manga") - .WithMany() - .HasForeignKey("MangaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Manga"); - }); - - modelBuilder.Entity("API.Schema.Manga", b => - { - b.Navigation("Chapters"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/API/Migrations/20250509035413_Initial-3.cs b/API/Migrations/20250509035413_Initial-3.cs deleted file mode 100644 index 1b96dac..0000000 --- a/API/Migrations/20250509035413_Initial-3.cs +++ /dev/null @@ -1,130 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace API.Migrations -{ - /// - public partial class Initial3 : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AltTitles"); - - migrationBuilder.DropTable( - name: "Links"); - - migrationBuilder.CreateTable( - name: "Link", - columns: table => new - { - LinkId = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), - LinkProvider = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), - LinkUrl = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: false), - MangaId = table.Column(type: "character varying(64)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Link", x => x.LinkId); - table.ForeignKey( - name: "FK_Link_Mangas_MangaId", - column: x => x.MangaId, - principalTable: "Mangas", - principalColumn: "MangaId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "MangaAltTitle", - 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: "character varying(256)", maxLength: 256, nullable: false), - MangaId = table.Column(type: "character varying(64)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_MangaAltTitle", x => x.AltTitleId); - table.ForeignKey( - name: "FK_MangaAltTitle_Mangas_MangaId", - column: x => x.MangaId, - principalTable: "Mangas", - principalColumn: "MangaId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_Link_MangaId", - table: "Link", - column: "MangaId"); - - migrationBuilder.CreateIndex( - name: "IX_MangaAltTitle_MangaId", - table: "MangaAltTitle", - column: "MangaId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Link"); - - migrationBuilder.DropTable( - name: "MangaAltTitle"); - - 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), - MangaId = table.Column(type: "character varying(64)", nullable: false), - Title = table.Column(type: "character varying(256)", maxLength: 256, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AltTitles", x => x.AltTitleId); - table.ForeignKey( - name: "FK_AltTitles_Mangas_MangaId", - column: x => x.MangaId, - principalTable: "Mangas", - principalColumn: "MangaId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Links", - columns: table => new - { - LinkId = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), - LinkProvider = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), - LinkUrl = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: false), - MangaId = table.Column(type: "character varying(64)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Links", x => x.LinkId); - table.ForeignKey( - name: "FK_Links_Mangas_MangaId", - column: x => x.MangaId, - principalTable: "Mangas", - principalColumn: "MangaId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_AltTitles_MangaId", - table: "AltTitles", - column: "MangaId"); - - migrationBuilder.CreateIndex( - name: "IX_Links_MangaId", - table: "Links", - column: "MangaId"); - } - } -} diff --git a/API/Migrations/20250509035606_Initial-4.Designer.cs b/API/Migrations/20250509035606_Initial-4.Designer.cs deleted file mode 100644 index 07c02c3..0000000 --- a/API/Migrations/20250509035606_Initial-4.Designer.cs +++ /dev/null @@ -1,784 +0,0 @@ -// -using System; -using System.Collections.Generic; -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("20250509035606_Initial-4")] - partial class Initial4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "hstore"); - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("API.Schema.Author", b => - { - b.Property("AuthorId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("AuthorName") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.HasKey("AuthorId"); - - b.ToTable("Authors"); - }); - - modelBuilder.Entity("API.Schema.Chapter", b => - { - b.Property("ChapterId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ChapterNumber") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Downloaded") - .HasColumnType("boolean"); - - b.Property("FileName") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("ParentMangaId") - .IsRequired() - .HasColumnType("character varying(64)"); - - b.Property("Title") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("Url") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - 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.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("JobType") - .HasColumnType("smallint"); - - b.Property("LastExecution") - .HasColumnType("timestamp with time zone"); - - b.Property("ParentJobId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("RecurrenceMs") - .HasColumnType("numeric(20,0)"); - - b.Property("state") - .HasColumnType("smallint"); - - b.HasKey("JobId"); - - 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() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("BaseUrl") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("LibraryType") - .HasColumnType("smallint"); - - b.HasKey("LibraryConnectorId"); - - b.ToTable("LibraryConnectors"); - - b.HasDiscriminator("LibraryType"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("API.Schema.LocalLibrary", b => - { - b.Property("LocalLibraryId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("BasePath") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("LibraryName") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.HasKey("LocalLibraryId"); - - b.ToTable("LocalLibraries"); - }); - - modelBuilder.Entity("API.Schema.Manga", b => - { - b.Property("MangaId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CoverFileNameInCache") - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("CoverUrl") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("DirectoryName") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)"); - - b.Property("IdOnConnectorSite") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("IgnoreChaptersBefore") - .HasColumnType("real"); - - b.Property("LibraryId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("MangaConnectorName") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("OriginalLanguage") - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b.Property("ReleaseStatus") - .HasColumnType("smallint"); - - b.Property("WebsiteUrl") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("Year") - .HasColumnType("bigint"); - - b.HasKey("MangaId"); - - b.HasIndex("LibraryId"); - - b.HasIndex("MangaConnectorName"); - - b.ToTable("Mangas"); - }); - - modelBuilder.Entity("API.Schema.MangaConnectors.MangaConnector", b => - { - b.Property("Name") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.PrimitiveCollection("BaseUris") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("text[]"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("IconUrl") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b.PrimitiveCollection("SupportedLanguages") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("text[]"); - - b.HasKey("Name"); - - b.ToTable("MangaConnectors"); - - b.HasDiscriminator("Name").HasValue("MangaConnector"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("API.Schema.MangaTag", b => - { - b.Property("Tag") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - 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() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("Urgency") - .HasColumnType("smallint"); - - b.HasKey("NotificationId"); - - b.ToTable("Notifications"); - }); - - modelBuilder.Entity("API.Schema.NotificationConnectors.NotificationConnector", b => - { - b.Property("Name") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Body") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)"); - - b.Property>("Headers") - .IsRequired() - .HasColumnType("hstore"); - - b.Property("HttpMethod") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b.Property("Url") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b.HasKey("Name"); - - b.ToTable("NotificationConnectors"); - }); - - modelBuilder.Entity("AuthorToManga", b => - { - b.Property("AuthorIds") - .HasColumnType("character varying(64)"); - - b.Property("MangaIds") - .HasColumnType("character varying(64)"); - - b.HasKey("AuthorIds", "MangaIds"); - - b.HasIndex("MangaIds"); - - b.ToTable("AuthorToManga"); - }); - - modelBuilder.Entity("JobJob", b => - { - b.Property("DependsOnJobsJobId") - .HasColumnType("character varying(64)"); - - b.Property("JobId") - .HasColumnType("character varying(64)"); - - b.HasKey("DependsOnJobsJobId", "JobId"); - - b.HasIndex("JobId"); - - b.ToTable("JobJob"); - }); - - modelBuilder.Entity("MangaTagToManga", b => - { - b.Property("MangaTagIds") - .HasColumnType("character varying(64)"); - - b.Property("MangaIds") - .HasColumnType("character varying(64)"); - - b.HasKey("MangaTagIds", "MangaIds"); - - b.HasIndex("MangaIds"); - - b.ToTable("MangaTagToManga"); - }); - - modelBuilder.Entity("API.Schema.Jobs.DownloadAvailableChaptersJob", 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("DownloadAvailableChaptersJob_MangaId"); - }); - - b.HasDiscriminator().HasValue((byte)1); - }); - - modelBuilder.Entity("API.Schema.Jobs.DownloadMangaCoverJob", b => - { - b.HasBaseType("API.Schema.Jobs.Job"); - - b.Property("MangaId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasIndex("MangaId"); - - b.HasDiscriminator().HasValue((byte)4); - }); - - 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() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("ToLocation") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.HasDiscriminator().HasValue((byte)3); - }); - - modelBuilder.Entity("API.Schema.Jobs.MoveMangaLibraryJob", b => - { - b.HasBaseType("API.Schema.Jobs.Job"); - - b.Property("MangaId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ToLibraryId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasIndex("MangaId"); - - b.HasIndex("ToLibraryId"); - - b.ToTable("Jobs", t => - { - t.Property("MangaId") - .HasColumnName("MoveMangaLibraryJob_MangaId"); - }); - - b.HasDiscriminator().HasValue((byte)7); - }); - - modelBuilder.Entity("API.Schema.Jobs.RetrieveChaptersJob", b => - { - b.HasBaseType("API.Schema.Jobs.Job"); - - b.Property("Language") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b.Property("MangaId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasIndex("MangaId"); - - b.ToTable("Jobs", t => - { - t.Property("MangaId") - .HasColumnName("RetrieveChaptersJob_MangaId"); - }); - - b.HasDiscriminator().HasValue((byte)5); - }); - - modelBuilder.Entity("API.Schema.Jobs.UpdateFilesDownloadedJob", 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("UpdateFilesDownloadedJob_MangaId"); - }); - - b.HasDiscriminator().HasValue((byte)6); - }); - - 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.Global", b => - { - b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); - - b.HasDiscriminator().HasValue("Global"); - }); - - modelBuilder.Entity("API.Schema.MangaConnectors.MangaDex", b => - { - b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); - - b.HasDiscriminator().HasValue("MangaDex"); - }); - - modelBuilder.Entity("API.Schema.Chapter", b => - { - b.HasOne("API.Schema.Manga", "ParentManga") - .WithMany("Chapters") - .HasForeignKey("ParentMangaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ParentManga"); - }); - - modelBuilder.Entity("API.Schema.Jobs.Job", b => - { - b.HasOne("API.Schema.Jobs.Job", "ParentJob") - .WithMany() - .HasForeignKey("ParentJobId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("ParentJob"); - }); - - modelBuilder.Entity("API.Schema.Manga", b => - { - b.HasOne("API.Schema.LocalLibrary", "Library") - .WithMany() - .HasForeignKey("LibraryId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("API.Schema.MangaConnectors.MangaConnector", "MangaConnector") - .WithMany() - .HasForeignKey("MangaConnectorName") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("API.Schema.Link", "Links", b1 => - { - b1.Property("LinkId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("LinkProvider") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("LinkUrl") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b1.Property("MangaId") - .IsRequired() - .HasColumnType("character varying(64)"); - - b1.HasKey("LinkId"); - - b1.HasIndex("MangaId"); - - b1.ToTable("Link"); - - b1.WithOwner() - .HasForeignKey("MangaId"); - }); - - b.OwnsMany("API.Schema.MangaAltTitle", "AltTitles", b1 => - { - b1.Property("AltTitleId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Language") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b1.Property("MangaId") - .IsRequired() - .HasColumnType("character varying(64)"); - - b1.Property("Title") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b1.HasKey("AltTitleId"); - - b1.HasIndex("MangaId"); - - b1.ToTable("MangaAltTitle"); - - b1.WithOwner() - .HasForeignKey("MangaId"); - }); - - b.Navigation("AltTitles"); - - b.Navigation("Library"); - - b.Navigation("Links"); - - b.Navigation("MangaConnector"); - }); - - modelBuilder.Entity("AuthorToManga", b => - { - b.HasOne("API.Schema.Author", null) - .WithMany() - .HasForeignKey("AuthorIds") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("API.Schema.Manga", null) - .WithMany() - .HasForeignKey("MangaIds") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("JobJob", b => - { - b.HasOne("API.Schema.Jobs.Job", null) - .WithMany() - .HasForeignKey("DependsOnJobsJobId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("API.Schema.Jobs.Job", null) - .WithMany() - .HasForeignKey("JobId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("MangaTagToManga", b => - { - b.HasOne("API.Schema.Manga", null) - .WithMany() - .HasForeignKey("MangaIds") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("API.Schema.MangaTag", null) - .WithMany() - .HasForeignKey("MangaTagIds") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("API.Schema.Jobs.DownloadAvailableChaptersJob", b => - { - b.HasOne("API.Schema.Manga", "Manga") - .WithMany() - .HasForeignKey("MangaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Manga"); - }); - - modelBuilder.Entity("API.Schema.Jobs.DownloadMangaCoverJob", 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.MoveMangaLibraryJob", b => - { - b.HasOne("API.Schema.Manga", "Manga") - .WithMany() - .HasForeignKey("MangaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("API.Schema.LocalLibrary", "ToLibrary") - .WithMany() - .HasForeignKey("ToLibraryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Manga"); - - b.Navigation("ToLibrary"); - }); - - modelBuilder.Entity("API.Schema.Jobs.RetrieveChaptersJob", b => - { - b.HasOne("API.Schema.Manga", "Manga") - .WithMany() - .HasForeignKey("MangaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Manga"); - }); - - modelBuilder.Entity("API.Schema.Jobs.UpdateFilesDownloadedJob", b => - { - b.HasOne("API.Schema.Manga", "Manga") - .WithMany() - .HasForeignKey("MangaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Manga"); - }); - - modelBuilder.Entity("API.Schema.Manga", b => - { - b.Navigation("Chapters"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/API/Migrations/20250509035606_Initial-4.cs b/API/Migrations/20250509035606_Initial-4.cs deleted file mode 100644 index f81421f..0000000 --- a/API/Migrations/20250509035606_Initial-4.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace API.Migrations -{ - /// - public partial class Initial4 : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "LibraryId", - table: "Mangas", - type: "character varying(64)", - maxLength: 64, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(64)", - oldMaxLength: 64); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "LibraryId", - table: "Mangas", - type: "character varying(64)", - maxLength: 64, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "character varying(64)", - oldMaxLength: 64, - oldNullable: true); - } - } -} diff --git a/API/Migrations/20250509035754_Initial-5.cs b/API/Migrations/20250509035754_Initial-5.cs deleted file mode 100644 index aadc22d..0000000 --- a/API/Migrations/20250509035754_Initial-5.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace API.Migrations -{ - /// - public partial class Initial5 : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "ParentJobId", - table: "Jobs", - type: "character varying(64)", - maxLength: 64, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(64)", - oldMaxLength: 64); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "ParentJobId", - table: "Jobs", - type: "character varying(64)", - maxLength: 64, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "character varying(64)", - oldMaxLength: 64, - oldNullable: true); - } - } -} diff --git a/API/Migrations/library/20250515120732_Initial.Designer.cs b/API/Migrations/library/20250515120732_Initial.Designer.cs new file mode 100644 index 0000000..c086b4e --- /dev/null +++ b/API/Migrations/library/20250515120732_Initial.Designer.cs @@ -0,0 +1,71 @@ +// +using API.Schema.Contexts; +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.library +{ + [DbContext(typeof(LibraryContext))] + [Migration("20250515120732_Initial")] + partial class Initial + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.3") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("API.Schema.LibraryConnectors.LibraryConnector", b => + { + b.Property("LibraryConnectorId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Auth") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("BaseUrl") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("LibraryType") + .HasColumnType("smallint"); + + b.HasKey("LibraryConnectorId"); + + b.ToTable("LibraryConnectors"); + + b.HasDiscriminator("LibraryType"); + + b.UseTphMappingStrategy(); + }); + + 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); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/API/Migrations/library/20250515120732_Initial.cs b/API/Migrations/library/20250515120732_Initial.cs new file mode 100644 index 0000000..3ad2851 --- /dev/null +++ b/API/Migrations/library/20250515120732_Initial.cs @@ -0,0 +1,35 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace API.Migrations.library +{ + /// + public partial class Initial : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "LibraryConnectors", + columns: table => new + { + LibraryConnectorId = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + LibraryType = table.Column(type: "smallint", nullable: false), + BaseUrl = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + Auth = table.Column(type: "character varying(256)", maxLength: 256, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_LibraryConnectors", x => x.LibraryConnectorId); + }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "LibraryConnectors"); + } + } +} diff --git a/API/Migrations/library/LibraryContextModelSnapshot.cs b/API/Migrations/library/LibraryContextModelSnapshot.cs new file mode 100644 index 0000000..d79d7f0 --- /dev/null +++ b/API/Migrations/library/LibraryContextModelSnapshot.cs @@ -0,0 +1,68 @@ +// +using API.Schema.Contexts; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace API.Migrations.library +{ + [DbContext(typeof(LibraryContext))] + partial class LibraryContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.3") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("API.Schema.LibraryConnectors.LibraryConnector", b => + { + b.Property("LibraryConnectorId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Auth") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("BaseUrl") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("LibraryType") + .HasColumnType("smallint"); + + b.HasKey("LibraryConnectorId"); + + b.ToTable("LibraryConnectors"); + + b.HasDiscriminator("LibraryType"); + + b.UseTphMappingStrategy(); + }); + + 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); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/API/Migrations/notifications/20250515120746_Initial.Designer.cs b/API/Migrations/notifications/20250515120746_Initial.Designer.cs new file mode 100644 index 0000000..396d022 --- /dev/null +++ b/API/Migrations/notifications/20250515120746_Initial.Designer.cs @@ -0,0 +1,89 @@ +// +using System; +using System.Collections.Generic; +using API.Schema.Contexts; +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.notifications +{ + [DbContext(typeof(NotificationsContext))] + [Migration("20250515120746_Initial")] + partial class Initial + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.3") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "hstore"); + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + 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() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Urgency") + .HasColumnType("smallint"); + + b.HasKey("NotificationId"); + + b.ToTable("Notifications"); + }); + + modelBuilder.Entity("API.Schema.NotificationConnectors.NotificationConnector", b => + { + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Body") + .IsRequired() + .HasMaxLength(4096) + .HasColumnType("character varying(4096)"); + + b.Property>("Headers") + .IsRequired() + .HasColumnType("hstore"); + + b.Property("HttpMethod") + .IsRequired() + .HasMaxLength(8) + .HasColumnType("character varying(8)"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.HasKey("Name"); + + b.ToTable("NotificationConnectors"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/API/Migrations/notifications/20250515120746_Initial.cs b/API/Migrations/notifications/20250515120746_Initial.cs new file mode 100644 index 0000000..8ab8590 --- /dev/null +++ b/API/Migrations/notifications/20250515120746_Initial.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace API.Migrations.notifications +{ + /// + public partial class Initial : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterDatabase() + .Annotation("Npgsql:PostgresExtension:hstore", ",,"); + + migrationBuilder.CreateTable( + name: "NotificationConnectors", + columns: table => new + { + Name = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + Url = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: false), + Headers = table.Column>(type: "hstore", nullable: false), + HttpMethod = table.Column(type: "character varying(8)", maxLength: 8, nullable: false), + Body = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_NotificationConnectors", x => x.Name); + }); + + 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: "character varying(128)", maxLength: 128, nullable: false), + Message = table.Column(type: "character varying(512)", maxLength: 512, nullable: false), + Date = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Notifications", x => x.NotificationId); + }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "NotificationConnectors"); + + migrationBuilder.DropTable( + name: "Notifications"); + } + } +} diff --git a/API/Migrations/notifications/NotificationsContextModelSnapshot.cs b/API/Migrations/notifications/NotificationsContextModelSnapshot.cs new file mode 100644 index 0000000..a0f7e0a --- /dev/null +++ b/API/Migrations/notifications/NotificationsContextModelSnapshot.cs @@ -0,0 +1,86 @@ +// +using System; +using System.Collections.Generic; +using API.Schema.Contexts; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace API.Migrations.notifications +{ + [DbContext(typeof(NotificationsContext))] + partial class NotificationsContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.3") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "hstore"); + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + 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() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Urgency") + .HasColumnType("smallint"); + + b.HasKey("NotificationId"); + + b.ToTable("Notifications"); + }); + + modelBuilder.Entity("API.Schema.NotificationConnectors.NotificationConnector", b => + { + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Body") + .IsRequired() + .HasMaxLength(4096) + .HasColumnType("character varying(4096)"); + + b.Property>("Headers") + .IsRequired() + .HasColumnType("hstore"); + + b.Property("HttpMethod") + .IsRequired() + .HasMaxLength(8) + .HasColumnType("character varying(8)"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.HasKey("Name"); + + b.ToTable("NotificationConnectors"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/API/Migrations/20250509035754_Initial-5.Designer.cs b/API/Migrations/pgsql/20250515120724_Initial-1.Designer.cs similarity index 86% rename from API/Migrations/20250509035754_Initial-5.Designer.cs rename to API/Migrations/pgsql/20250515120724_Initial-1.Designer.cs index 22b2b57..9b0185b 100644 --- a/API/Migrations/20250509035754_Initial-5.Designer.cs +++ b/API/Migrations/pgsql/20250515120724_Initial-1.Designer.cs @@ -1,7 +1,6 @@ // using System; -using System.Collections.Generic; -using API.Schema; +using API.Schema.Contexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; @@ -10,11 +9,11 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable -namespace API.Migrations +namespace API.Migrations.pgsql { [DbContext(typeof(PgsqlContext))] - [Migration("20250509035754_Initial-5")] - partial class Initial5 + [Migration("20250515120724_Initial-1")] + partial class Initial1 { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -24,7 +23,6 @@ namespace API.Migrations .HasAnnotation("ProductVersion", "9.0.3") .HasAnnotation("Relational:MaxIdentifierLength", 63); - NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "hstore"); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("API.Schema.Author", b => @@ -121,34 +119,6 @@ namespace API.Migrations b.UseTphMappingStrategy(); }); - modelBuilder.Entity("API.Schema.LibraryConnectors.LibraryConnector", b => - { - b.Property("LibraryConnectorId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Auth") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("BaseUrl") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("LibraryType") - .HasColumnType("smallint"); - - b.HasKey("LibraryConnectorId"); - - b.ToTable("LibraryConnectors"); - - b.HasDiscriminator("LibraryType"); - - b.UseTphMappingStrategy(); - }); - modelBuilder.Entity("API.Schema.LocalLibrary", b => { b.Property("LocalLibraryId") @@ -284,63 +254,6 @@ 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() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("Urgency") - .HasColumnType("smallint"); - - b.HasKey("NotificationId"); - - b.ToTable("Notifications"); - }); - - modelBuilder.Entity("API.Schema.NotificationConnectors.NotificationConnector", b => - { - b.Property("Name") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Body") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)"); - - b.Property>("Headers") - .IsRequired() - .HasColumnType("hstore"); - - b.Property("HttpMethod") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b.Property("Url") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b.HasKey("Name"); - - b.ToTable("NotificationConnectors"); - }); - modelBuilder.Entity("AuthorToManga", b => { b.Property("AuthorIds") @@ -523,20 +436,6 @@ namespace API.Migrations b.HasDiscriminator().HasValue((byte)6); }); - 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.Global", b => { b.HasBaseType("API.Schema.MangaConnectors.MangaConnector"); diff --git a/API/Migrations/20250509033915_Initial.cs b/API/Migrations/pgsql/20250515120724_Initial-1.cs similarity index 84% rename from API/Migrations/20250509033915_Initial.cs rename to API/Migrations/pgsql/20250515120724_Initial-1.cs index 509a34d..97295f0 100644 --- a/API/Migrations/20250509033915_Initial.cs +++ b/API/Migrations/pgsql/20250515120724_Initial-1.cs @@ -1,20 +1,16 @@ using System; -using System.Collections.Generic; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable -namespace API.Migrations +namespace API.Migrations.pgsql { /// - public partial class Initial : Migration + public partial class Initial1 : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.AlterDatabase() - .Annotation("Npgsql:PostgresExtension:hstore", ",,"); - migrationBuilder.CreateTable( name: "Authors", columns: table => new @@ -27,20 +23,6 @@ namespace API.Migrations table.PrimaryKey("PK_Authors", x => x.AuthorId); }); - migrationBuilder.CreateTable( - name: "LibraryConnectors", - columns: table => new - { - LibraryConnectorId = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), - LibraryType = table.Column(type: "smallint", nullable: false), - BaseUrl = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), - Auth = table.Column(type: "character varying(256)", maxLength: 256, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_LibraryConnectors", x => x.LibraryConnectorId); - }); - migrationBuilder.CreateTable( name: "LocalLibraries", columns: table => new @@ -69,36 +51,6 @@ namespace API.Migrations table.PrimaryKey("PK_MangaConnectors", x => x.Name); }); - migrationBuilder.CreateTable( - name: "NotificationConnectors", - columns: table => new - { - Name = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), - Url = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: false), - Headers = table.Column>(type: "hstore", nullable: false), - HttpMethod = table.Column(type: "character varying(8)", maxLength: 8, nullable: false), - Body = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_NotificationConnectors", x => x.Name); - }); - - 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: "character varying(128)", maxLength: 128, nullable: false), - Message = table.Column(type: "character varying(512)", maxLength: 512, 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 @@ -121,7 +73,7 @@ namespace API.Migrations WebsiteUrl = table.Column(type: "character varying(512)", maxLength: 512, nullable: false), CoverUrl = table.Column(type: "character varying(512)", maxLength: 512, nullable: false), ReleaseStatus = table.Column(type: "smallint", nullable: false), - LibraryId = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + LibraryId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), MangaConnectorName = table.Column(type: "character varying(32)", maxLength: 32, nullable: false), IgnoreChaptersBefore = table.Column(type: "real", nullable: false), DirectoryName = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: false), @@ -146,26 +98,6 @@ namespace API.Migrations 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: "character varying(256)", maxLength: 256, nullable: false), - MangaId = table.Column(type: "character varying(64)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AltTitles", x => x.AltTitleId); - table.ForeignKey( - name: "FK_AltTitles_Mangas_MangaId", - column: x => x.MangaId, - principalTable: "Mangas", - principalColumn: "MangaId", - onDelete: ReferentialAction.Cascade); - }); - migrationBuilder.CreateTable( name: "AuthorToManga", columns: table => new @@ -215,7 +147,7 @@ namespace API.Migrations }); migrationBuilder.CreateTable( - name: "Links", + name: "Link", columns: table => new { LinkId = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), @@ -225,9 +157,29 @@ namespace API.Migrations }, constraints: table => { - table.PrimaryKey("PK_Links", x => x.LinkId); + table.PrimaryKey("PK_Link", x => x.LinkId); table.ForeignKey( - name: "FK_Links_Mangas_MangaId", + name: "FK_Link_Mangas_MangaId", + column: x => x.MangaId, + principalTable: "Mangas", + principalColumn: "MangaId", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "MangaAltTitle", + 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: "character varying(256)", maxLength: 256, nullable: false), + MangaId = table.Column(type: "character varying(64)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_MangaAltTitle", x => x.AltTitleId); + table.ForeignKey( + name: "FK_MangaAltTitle_Mangas_MangaId", column: x => x.MangaId, principalTable: "Mangas", principalColumn: "MangaId", @@ -263,7 +215,7 @@ namespace API.Migrations columns: table => new { JobId = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), - ParentJobId = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + ParentJobId = table.Column(type: "character varying(64)", 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), @@ -357,11 +309,6 @@ namespace API.Migrations onDelete: ReferentialAction.Cascade); }); - migrationBuilder.CreateIndex( - name: "IX_AltTitles_MangaId", - table: "AltTitles", - column: "MangaId"); - migrationBuilder.CreateIndex( name: "IX_AuthorToManga_MangaIds", table: "AuthorToManga", @@ -418,8 +365,13 @@ namespace API.Migrations column: "UpdateFilesDownloadedJob_MangaId"); migrationBuilder.CreateIndex( - name: "IX_Links_MangaId", - table: "Links", + name: "IX_Link_MangaId", + table: "Link", + column: "MangaId"); + + migrationBuilder.CreateIndex( + name: "IX_MangaAltTitle_MangaId", + table: "MangaAltTitle", column: "MangaId"); migrationBuilder.CreateIndex( @@ -441,9 +393,6 @@ namespace API.Migrations /// protected override void Down(MigrationBuilder migrationBuilder) { - migrationBuilder.DropTable( - name: "AltTitles"); - migrationBuilder.DropTable( name: "AuthorToManga"); @@ -451,20 +400,14 @@ namespace API.Migrations name: "JobJob"); migrationBuilder.DropTable( - name: "LibraryConnectors"); + name: "Link"); migrationBuilder.DropTable( - name: "Links"); + name: "MangaAltTitle"); migrationBuilder.DropTable( name: "MangaTagToManga"); - migrationBuilder.DropTable( - name: "NotificationConnectors"); - - migrationBuilder.DropTable( - name: "Notifications"); - migrationBuilder.DropTable( name: "Authors"); diff --git a/API/Migrations/PgsqlContextModelSnapshot.cs b/API/Migrations/pgsql/PgsqlContextModelSnapshot.cs similarity index 86% rename from API/Migrations/PgsqlContextModelSnapshot.cs rename to API/Migrations/pgsql/PgsqlContextModelSnapshot.cs index a17d8c2..d7dd6c6 100644 --- a/API/Migrations/PgsqlContextModelSnapshot.cs +++ b/API/Migrations/pgsql/PgsqlContextModelSnapshot.cs @@ -1,7 +1,6 @@ // using System; -using System.Collections.Generic; -using API.Schema; +using API.Schema.Contexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; @@ -9,7 +8,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable -namespace API.Migrations +namespace API.Migrations.pgsql { [DbContext(typeof(PgsqlContext))] partial class PgsqlContextModelSnapshot : ModelSnapshot @@ -21,7 +20,6 @@ namespace API.Migrations .HasAnnotation("ProductVersion", "9.0.3") .HasAnnotation("Relational:MaxIdentifierLength", 63); - NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "hstore"); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("API.Schema.Author", b => @@ -118,34 +116,6 @@ namespace API.Migrations b.UseTphMappingStrategy(); }); - modelBuilder.Entity("API.Schema.LibraryConnectors.LibraryConnector", b => - { - b.Property("LibraryConnectorId") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Auth") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("BaseUrl") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("LibraryType") - .HasColumnType("smallint"); - - b.HasKey("LibraryConnectorId"); - - b.ToTable("LibraryConnectors"); - - b.HasDiscriminator("LibraryType"); - - b.UseTphMappingStrategy(); - }); - modelBuilder.Entity("API.Schema.LocalLibrary", b => { b.Property("LocalLibraryId") @@ -281,63 +251,6 @@ 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() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("Urgency") - .HasColumnType("smallint"); - - b.HasKey("NotificationId"); - - b.ToTable("Notifications"); - }); - - modelBuilder.Entity("API.Schema.NotificationConnectors.NotificationConnector", b => - { - b.Property("Name") - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Body") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)"); - - b.Property>("Headers") - .IsRequired() - .HasColumnType("hstore"); - - b.Property("HttpMethod") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b.Property("Url") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b.HasKey("Name"); - - b.ToTable("NotificationConnectors"); - }); - modelBuilder.Entity("AuthorToManga", b => { b.Property("AuthorIds") @@ -520,20 +433,6 @@ namespace API.Migrations b.HasDiscriminator().HasValue((byte)6); }); - 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.Global", b => { b.HasBaseType("API.Schema.MangaConnectors.MangaConnector");