Fixed Migrations

pull/12798/head
JPVenson 4 months ago
parent 10a2a316a4
commit d4ca8d58c4

@ -1,152 +0,0 @@
using System;
using System.Runtime.CompilerServices;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Jellyfin.Server.Implementations.Migrations
{
/// <inheritdoc />
public partial class LibraryPeopleMigration : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Peoples_BaseItems_ItemId",
table: "Peoples");
migrationBuilder.DropPrimaryKey(
name: "PK_Peoples",
table: "Peoples");
migrationBuilder.DropIndex(
name: "IX_Peoples_ItemId_ListOrder",
table: "Peoples");
migrationBuilder.DropColumn(
name: "ListOrder",
table: "Peoples");
migrationBuilder.DropColumn(
name: "SortOrder",
table: "Peoples");
migrationBuilder.RenameColumn(
name: "ItemId",
table: "Peoples",
newName: "Id");
migrationBuilder.AlterColumn<string>(
name: "Role",
table: "Peoples",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT");
migrationBuilder.AddPrimaryKey(
name: "PK_Peoples",
table: "Peoples",
column: "Id");
migrationBuilder.CreateTable(
name: "PeopleBaseItemMap",
columns: table => new
{
ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
PeopleId = table.Column<Guid>(type: "TEXT", nullable: false),
SortOrder = table.Column<int>(type: "INTEGER", nullable: true),
ListOrder = table.Column<int>(type: "INTEGER", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PeopleBaseItemMap", x => new { x.ItemId, x.PeopleId });
table.ForeignKey(
name: "FK_PeopleBaseItemMap_BaseItems_ItemId",
column: x => x.ItemId,
principalTable: "BaseItems",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PeopleBaseItemMap_Peoples_PeopleId",
column: x => x.PeopleId,
principalTable: "Peoples",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_PeopleBaseItemMap_ItemId_ListOrder",
table: "PeopleBaseItemMap",
columns: new[] { "ItemId", "ListOrder" });
migrationBuilder.CreateIndex(
name: "IX_PeopleBaseItemMap_ItemId_SortOrder",
table: "PeopleBaseItemMap",
columns: new[] { "ItemId", "SortOrder" });
migrationBuilder.CreateIndex(
name: "IX_PeopleBaseItemMap_PeopleId",
table: "PeopleBaseItemMap",
column: "PeopleId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PeopleBaseItemMap");
migrationBuilder.DropPrimaryKey(
name: "PK_Peoples",
table: "Peoples");
migrationBuilder.RenameColumn(
name: "Id",
table: "Peoples",
newName: "ItemId");
migrationBuilder.AlterColumn<string>(
name: "Role",
table: "Peoples",
type: "TEXT",
nullable: false,
defaultValue: string.Empty,
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AddColumn<int>(
name: "ListOrder",
table: "Peoples",
type: "INTEGER",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "SortOrder",
table: "Peoples",
type: "INTEGER",
nullable: true);
migrationBuilder.AddPrimaryKey(
name: "PK_Peoples",
table: "Peoples",
columns: new[] { "ItemId", "Role", "ListOrder" });
migrationBuilder.CreateIndex(
name: "IX_Peoples_ItemId_ListOrder",
table: "Peoples",
columns: new[] { "ItemId", "ListOrder" });
migrationBuilder.AddForeignKey(
name: "FK_Peoples_BaseItems_ItemId",
table: "Peoples",
column: "ItemId",
principalTable: "BaseItems",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

@ -1,38 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Jellyfin.Server.Implementations.Migrations
{
/// <inheritdoc />
public partial class LibraryPeopleRoleMigration : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Role",
table: "Peoples");
migrationBuilder.AddColumn<string>(
name: "Role",
table: "PeopleBaseItemMap",
type: "TEXT",
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Role",
table: "PeopleBaseItemMap");
migrationBuilder.AddColumn<string>(
name: "Role",
table: "Peoples",
type: "TEXT",
nullable: true);
}
}
}

@ -11,8 +11,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Jellyfin.Server.Implementations.Migrations namespace Jellyfin.Server.Implementations.Migrations
{ {
[DbContext(typeof(JellyfinDbContext))] [DbContext(typeof(JellyfinDbContext))]
[Migration("20241011095125_LibraryPeopleMigration")] [Migration("20241020103111_LibraryDbMigration")]
partial class LibraryPeopleMigration partial class LibraryDbMigration
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -356,9 +356,6 @@ namespace Jellyfin.Server.Implementations.Migrations
b.Property<string>("UnratedType") b.Property<string>("UnratedType")
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("UserDataKey")
.HasColumnType("TEXT");
b.Property<int?>("Width") b.Property<int?>("Width")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
@ -372,8 +369,6 @@ namespace Jellyfin.Server.Implementations.Migrations
b.HasIndex("TopParentId", "Id"); b.HasIndex("TopParentId", "Id");
b.HasIndex("UserDataKey", "Type");
b.HasIndex("Type", "TopParentId", "Id"); b.HasIndex("Type", "TopParentId", "Id");
b.HasIndex("Type", "TopParentId", "PresentationUniqueKey"); b.HasIndex("Type", "TopParentId", "PresentationUniqueKey");
@ -925,9 +920,6 @@ namespace Jellyfin.Server.Implementations.Migrations
b.Property<string>("PersonType") b.Property<string>("PersonType")
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("Role")
.HasColumnType("TEXT");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("Name"); b.HasIndex("Name");
@ -946,6 +938,9 @@ namespace Jellyfin.Server.Implementations.Migrations
b.Property<int?>("ListOrder") b.Property<int?>("ListOrder")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
b.Property<string>("Role")
.HasColumnType("TEXT");
b.Property<int?>("SortOrder") b.Property<int?>("SortOrder")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
@ -1278,7 +1273,7 @@ namespace Jellyfin.Server.Implementations.Migrations
modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b =>
{ {
b.Property<string>("Key") b.Property<Guid>("ItemId")
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<Guid>("UserId") b.Property<Guid>("UserId")
@ -1287,9 +1282,6 @@ namespace Jellyfin.Server.Implementations.Migrations
b.Property<int?>("AudioStreamIndex") b.Property<int?>("AudioStreamIndex")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
b.Property<Guid?>("BaseItemEntityId")
.HasColumnType("TEXT");
b.Property<bool>("IsFavorite") b.Property<bool>("IsFavorite")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
@ -1314,19 +1306,17 @@ namespace Jellyfin.Server.Implementations.Migrations
b.Property<int?>("SubtitleStreamIndex") b.Property<int?>("SubtitleStreamIndex")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
b.HasKey("Key", "UserId"); b.HasKey("ItemId", "UserId");
b.HasIndex("BaseItemEntityId");
b.HasIndex("UserId"); b.HasIndex("UserId");
b.HasIndex("Key", "UserId", "IsFavorite"); b.HasIndex("ItemId", "UserId", "IsFavorite");
b.HasIndex("Key", "UserId", "LastPlayedDate"); b.HasIndex("ItemId", "UserId", "LastPlayedDate");
b.HasIndex("Key", "UserId", "PlaybackPositionTicks"); b.HasIndex("ItemId", "UserId", "PlaybackPositionTicks");
b.HasIndex("Key", "UserId", "Played"); b.HasIndex("ItemId", "UserId", "Played");
b.ToTable("UserData"); b.ToTable("UserData");
}); });
@ -1542,9 +1532,11 @@ namespace Jellyfin.Server.Implementations.Migrations
modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b =>
{ {
b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", null) b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
.WithMany("UserData") .WithMany("UserData")
.HasForeignKey("BaseItemEntityId"); .HasForeignKey("ItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Jellyfin.Data.Entities.User", "User") b.HasOne("Jellyfin.Data.Entities.User", "User")
.WithMany() .WithMany()
@ -1552,6 +1544,8 @@ namespace Jellyfin.Server.Implementations.Migrations
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Item");
b.Navigation("User"); b.Navigation("User");
}); });

@ -65,7 +65,6 @@ namespace Jellyfin.Server.Implementations.Migrations
NormalizationGain = table.Column<float>(type: "REAL", nullable: true), NormalizationGain = table.Column<float>(type: "REAL", nullable: true),
IsVirtualItem = table.Column<bool>(type: "INTEGER", nullable: false), IsVirtualItem = table.Column<bool>(type: "INTEGER", nullable: false),
SeriesName = table.Column<string>(type: "TEXT", nullable: true), SeriesName = table.Column<string>(type: "TEXT", nullable: true),
UserDataKey = table.Column<string>(type: "TEXT", nullable: true),
SeasonName = table.Column<string>(type: "TEXT", nullable: true), SeasonName = table.Column<string>(type: "TEXT", nullable: true),
ExternalSeriesId = table.Column<string>(type: "TEXT", nullable: true), ExternalSeriesId = table.Column<string>(type: "TEXT", nullable: true),
Tagline = table.Column<string>(type: "TEXT", nullable: true), Tagline = table.Column<string>(type: "TEXT", nullable: true),
@ -107,6 +106,19 @@ namespace Jellyfin.Server.Implementations.Migrations
table.PrimaryKey("PK_ItemValues", x => x.ItemValueId); table.PrimaryKey("PK_ItemValues", x => x.ItemValueId);
}); });
migrationBuilder.CreateTable(
name: "Peoples",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
Name = table.Column<string>(type: "TEXT", nullable: false),
PersonType = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Peoples", x => x.Id);
});
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "AncestorIds", name: "AncestorIds",
columns: table => new columns: table => new
@ -323,33 +335,11 @@ namespace Jellyfin.Server.Implementations.Migrations
onDelete: ReferentialAction.Cascade); onDelete: ReferentialAction.Cascade);
}); });
migrationBuilder.CreateTable(
name: "Peoples",
columns: table => new
{
ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
Role = table.Column<string>(type: "TEXT", nullable: false),
ListOrder = table.Column<int>(type: "INTEGER", nullable: false),
Name = table.Column<string>(type: "TEXT", nullable: false),
PersonType = table.Column<string>(type: "TEXT", nullable: true),
SortOrder = table.Column<int>(type: "INTEGER", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Peoples", x => new { x.ItemId, x.Role, x.ListOrder });
table.ForeignKey(
name: "FK_Peoples_BaseItems_ItemId",
column: x => x.ItemId,
principalTable: "BaseItems",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "UserData", name: "UserData",
columns: table => new columns: table => new
{ {
Key = table.Column<string>(type: "TEXT", nullable: false), ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
UserId = table.Column<Guid>(type: "TEXT", nullable: false), UserId = table.Column<Guid>(type: "TEXT", nullable: false),
Rating = table.Column<double>(type: "REAL", nullable: true), Rating = table.Column<double>(type: "REAL", nullable: true),
PlaybackPositionTicks = table.Column<long>(type: "INTEGER", nullable: false), PlaybackPositionTicks = table.Column<long>(type: "INTEGER", nullable: false),
@ -359,17 +349,17 @@ namespace Jellyfin.Server.Implementations.Migrations
Played = table.Column<bool>(type: "INTEGER", nullable: false), Played = table.Column<bool>(type: "INTEGER", nullable: false),
AudioStreamIndex = table.Column<int>(type: "INTEGER", nullable: true), AudioStreamIndex = table.Column<int>(type: "INTEGER", nullable: true),
SubtitleStreamIndex = table.Column<int>(type: "INTEGER", nullable: true), SubtitleStreamIndex = table.Column<int>(type: "INTEGER", nullable: true),
Likes = table.Column<bool>(type: "INTEGER", nullable: true), Likes = table.Column<bool>(type: "INTEGER", nullable: true)
BaseItemEntityId = table.Column<Guid>(type: "TEXT", nullable: true)
}, },
constraints: table => constraints: table =>
{ {
table.PrimaryKey("PK_UserData", x => new { x.Key, x.UserId }); table.PrimaryKey("PK_UserData", x => new { x.ItemId, x.UserId });
table.ForeignKey( table.ForeignKey(
name: "FK_UserData_BaseItems_BaseItemEntityId", name: "FK_UserData_BaseItems_ItemId",
column: x => x.BaseItemEntityId, column: x => x.ItemId,
principalTable: "BaseItems", principalTable: "BaseItems",
principalColumn: "Id"); principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey( table.ForeignKey(
name: "FK_UserData_Users_UserId", name: "FK_UserData_Users_UserId",
column: x => x.UserId, column: x => x.UserId,
@ -402,6 +392,33 @@ namespace Jellyfin.Server.Implementations.Migrations
onDelete: ReferentialAction.Cascade); onDelete: ReferentialAction.Cascade);
}); });
migrationBuilder.CreateTable(
name: "PeopleBaseItemMap",
columns: table => new
{
ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
PeopleId = table.Column<Guid>(type: "TEXT", nullable: false),
SortOrder = table.Column<int>(type: "INTEGER", nullable: true),
ListOrder = table.Column<int>(type: "INTEGER", nullable: true),
Role = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PeopleBaseItemMap", x => new { x.ItemId, x.PeopleId });
table.ForeignKey(
name: "FK_PeopleBaseItemMap_BaseItems_ItemId",
column: x => x.ItemId,
principalTable: "BaseItems",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PeopleBaseItemMap_Peoples_PeopleId",
column: x => x.PeopleId,
principalTable: "Peoples",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_AncestorIds_BaseItemEntityId", name: "IX_AncestorIds_BaseItemEntityId",
table: "AncestorIds", table: "AncestorIds",
@ -492,11 +509,6 @@ namespace Jellyfin.Server.Implementations.Migrations
table: "BaseItems", table: "BaseItems",
columns: new[] { "Type", "TopParentId", "StartDate" }); columns: new[] { "Type", "TopParentId", "StartDate" });
migrationBuilder.CreateIndex(
name: "IX_BaseItems_UserDataKey_Type",
table: "BaseItems",
columns: new[] { "UserDataKey", "Type" });
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_BaseItemTrailerTypes_ItemId", name: "IX_BaseItemTrailerTypes_ItemId",
table: "BaseItemTrailerTypes", table: "BaseItemTrailerTypes",
@ -533,39 +545,44 @@ namespace Jellyfin.Server.Implementations.Migrations
column: "StreamType"); column: "StreamType");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_Peoples_ItemId_ListOrder", name: "IX_PeopleBaseItemMap_ItemId_ListOrder",
table: "Peoples", table: "PeopleBaseItemMap",
columns: new[] { "ItemId", "ListOrder" }); columns: new[] { "ItemId", "ListOrder" });
migrationBuilder.CreateIndex(
name: "IX_PeopleBaseItemMap_ItemId_SortOrder",
table: "PeopleBaseItemMap",
columns: new[] { "ItemId", "SortOrder" });
migrationBuilder.CreateIndex(
name: "IX_PeopleBaseItemMap_PeopleId",
table: "PeopleBaseItemMap",
column: "PeopleId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_Peoples_Name", name: "IX_Peoples_Name",
table: "Peoples", table: "Peoples",
column: "Name"); column: "Name");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_UserData_BaseItemEntityId", name: "IX_UserData_ItemId_UserId_IsFavorite",
table: "UserData", table: "UserData",
column: "BaseItemEntityId"); columns: new[] { "ItemId", "UserId", "IsFavorite" });
migrationBuilder.CreateIndex(
name: "IX_UserData_Key_UserId_IsFavorite",
table: "UserData",
columns: new[] { "Key", "UserId", "IsFavorite" });
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_UserData_Key_UserId_LastPlayedDate", name: "IX_UserData_ItemId_UserId_LastPlayedDate",
table: "UserData", table: "UserData",
columns: new[] { "Key", "UserId", "LastPlayedDate" }); columns: new[] { "ItemId", "UserId", "LastPlayedDate" });
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_UserData_Key_UserId_PlaybackPositionTicks", name: "IX_UserData_ItemId_UserId_PlaybackPositionTicks",
table: "UserData", table: "UserData",
columns: new[] { "Key", "UserId", "PlaybackPositionTicks" }); columns: new[] { "ItemId", "UserId", "PlaybackPositionTicks" });
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_UserData_Key_UserId_Played", name: "IX_UserData_ItemId_UserId_Played",
table: "UserData", table: "UserData",
columns: new[] { "Key", "UserId", "Played" }); columns: new[] { "ItemId", "UserId", "Played" });
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_UserData_UserId", name: "IX_UserData_UserId",
@ -604,7 +621,7 @@ namespace Jellyfin.Server.Implementations.Migrations
name: "MediaStreamInfos"); name: "MediaStreamInfos");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Peoples"); name: "PeopleBaseItemMap");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "UserData"); name: "UserData");
@ -612,6 +629,9 @@ namespace Jellyfin.Server.Implementations.Migrations
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "ItemValues"); name: "ItemValues");
migrationBuilder.DropTable(
name: "Peoples");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "BaseItems"); name: "BaseItems");
} }

@ -353,9 +353,6 @@ namespace Jellyfin.Server.Implementations.Migrations
b.Property<string>("UnratedType") b.Property<string>("UnratedType")
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("UserDataKey")
.HasColumnType("TEXT");
b.Property<int?>("Width") b.Property<int?>("Width")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
@ -369,8 +366,6 @@ namespace Jellyfin.Server.Implementations.Migrations
b.HasIndex("TopParentId", "Id"); b.HasIndex("TopParentId", "Id");
b.HasIndex("UserDataKey", "Type");
b.HasIndex("Type", "TopParentId", "Id"); b.HasIndex("Type", "TopParentId", "Id");
b.HasIndex("Type", "TopParentId", "PresentationUniqueKey"); b.HasIndex("Type", "TopParentId", "PresentationUniqueKey");
@ -1275,7 +1270,7 @@ namespace Jellyfin.Server.Implementations.Migrations
modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b =>
{ {
b.Property<string>("Key") b.Property<Guid>("ItemId")
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<Guid>("UserId") b.Property<Guid>("UserId")
@ -1284,9 +1279,6 @@ namespace Jellyfin.Server.Implementations.Migrations
b.Property<int?>("AudioStreamIndex") b.Property<int?>("AudioStreamIndex")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
b.Property<Guid?>("BaseItemEntityId")
.HasColumnType("TEXT");
b.Property<bool>("IsFavorite") b.Property<bool>("IsFavorite")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
@ -1311,19 +1303,17 @@ namespace Jellyfin.Server.Implementations.Migrations
b.Property<int?>("SubtitleStreamIndex") b.Property<int?>("SubtitleStreamIndex")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
b.HasKey("Key", "UserId"); b.HasKey("ItemId", "UserId");
b.HasIndex("BaseItemEntityId");
b.HasIndex("UserId"); b.HasIndex("UserId");
b.HasIndex("Key", "UserId", "IsFavorite"); b.HasIndex("ItemId", "UserId", "IsFavorite");
b.HasIndex("Key", "UserId", "LastPlayedDate"); b.HasIndex("ItemId", "UserId", "LastPlayedDate");
b.HasIndex("Key", "UserId", "PlaybackPositionTicks"); b.HasIndex("ItemId", "UserId", "PlaybackPositionTicks");
b.HasIndex("Key", "UserId", "Played"); b.HasIndex("ItemId", "UserId", "Played");
b.ToTable("UserData"); b.ToTable("UserData");
}); });
@ -1539,9 +1529,11 @@ namespace Jellyfin.Server.Implementations.Migrations
modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b =>
{ {
b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", null) b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item")
.WithMany("UserData") .WithMany("UserData")
.HasForeignKey("BaseItemEntityId"); .HasForeignKey("ItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Jellyfin.Data.Entities.User", "User") b.HasOne("Jellyfin.Data.Entities.User", "User")
.WithMany() .WithMany()
@ -1549,6 +1541,8 @@ namespace Jellyfin.Server.Implementations.Migrations
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Item");
b.Navigation("User"); b.Navigation("User");
}); });

Loading…
Cancel
Save