Refactor database configuration and migrations for PostgreSQL support

- Updated default database configuration to use PostgreSQL instead of SQLite when no database.xml exists.
- Removed obsolete migration routines: MigrateUserDb, RemoveDuplicateExtras, ReseedFolderFlag.
- Introduced new read-only view projections for PostgreSQL: ItemPersonView, ItemProviderView, LibrarySummaryView, MediaStreamInfoView, UserPlaybackHistoryView, VideoItemView.
- Registered view mappings in PostgresDatabaseProvider to ensure proper handling of read-only views.
- Cleaned up unused SQLite cache size configuration in ConfigurationExtensions.

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-30 18:47:48 -04:00
parent 9fc10226c9
commit e1f7a4bee9
15 changed files with 637 additions and 429 deletions
@@ -0,0 +1,34 @@
// <copyright file="ItemProviderView.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Views;
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
/// <summary>
/// Read-only projection of library."ItemProviders_v".
/// Items with external provider IDs pivoted into named columns.
/// </summary>
public class ItemProviderView
{
public Guid? ItemId { get; set; }
public string? Type { get; set; }
public string? Name { get; set; }
public string? OriginalTitle { get; set; }
public int? ProductionYear { get; set; }
public string? SeriesName { get; set; }
public int? EpisodeNumber { get; set; }
public int? SeasonNumber { get; set; }
public string? ImdbId { get; set; }
public string? TmdbId { get; set; }
public string? TvdbId { get; set; }
public string? TvRageId { get; set; }
public string? MusicBrainzAlbumId { get; set; }
public string? MusicBrainzArtistId { get; set; }
/// <summary>Gets or sets remaining providers as a JSON object string.</summary>
public string? OtherProviders { get; set; }
}