mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-23 00:57:02 +01:00
Reorder migration handling for extra column
This commit is contained in:
@@ -270,6 +270,9 @@ namespace Jellyfin.Database.Providers.Sqlite.Migrations
|
||||
b.Property<string>("OfficialRating")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("OriginalLanguage")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("OriginalTitle")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
|
||||
@@ -23,12 +23,40 @@ namespace Jellyfin.Database.Providers.Sqlite.Migrations
|
||||
name: "BaseItemEntityId",
|
||||
table: "BaseItems");
|
||||
|
||||
migrationBuilder.Sql(
|
||||
"""
|
||||
UPDATE BaseItems
|
||||
SET OwnerId = '00000000-0000-0000-0000-000000000001'
|
||||
WHERE OwnerId IS NOT NULL
|
||||
AND OwnerId NOT IN (SELECT Id FROM BaseItems);
|
||||
""");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BaseItems_BaseItems_OwnerId",
|
||||
table: "BaseItems",
|
||||
column: "OwnerId",
|
||||
principalTable: "BaseItems",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsOriginal",
|
||||
table: "MediaStreamInfos",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "OriginalLanguage",
|
||||
table: "BaseItems",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "BaseItems",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("00000000-0000-0000-0000-000000000001"),
|
||||
column: "OriginalLanguage",
|
||||
value: null);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -62,6 +90,14 @@ namespace Jellyfin.Database.Providers.Sqlite.Migrations
|
||||
column: "BaseItemEntityId",
|
||||
principalTable: "BaseItems",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsOriginal",
|
||||
table: "MediaStreamInfos");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "OriginalLanguage",
|
||||
table: "BaseItems");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,6 +267,9 @@ namespace Jellyfin.Database.Providers.Sqlite.Migrations
|
||||
b.Property<string>("OfficialRating")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("OriginalLanguage")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("OriginalTitle")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
|
||||
@@ -267,6 +267,9 @@ namespace Jellyfin.Database.Providers.Sqlite.Migrations
|
||||
b.Property<string>("OfficialRating")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("OriginalLanguage")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("OriginalTitle")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
|
||||
@@ -267,6 +267,9 @@ namespace Jellyfin.Database.Providers.Sqlite.Migrations
|
||||
b.Property<string>("OfficialRating")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("OriginalLanguage")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("OriginalTitle")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
|
||||
@@ -267,6 +267,9 @@ namespace Jellyfin.Database.Providers.Sqlite.Migrations
|
||||
b.Property<string>("OfficialRating")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("OriginalLanguage")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("OriginalTitle")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
|
||||
@@ -267,6 +267,9 @@ namespace Jellyfin.Database.Providers.Sqlite.Migrations
|
||||
b.Property<string>("OfficialRating")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("OriginalLanguage")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("OriginalTitle")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
|
||||
@@ -267,6 +267,9 @@ namespace Jellyfin.Database.Providers.Sqlite.Migrations
|
||||
b.Property<string>("OfficialRating")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("OriginalLanguage")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("OriginalTitle")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
|
||||
@@ -267,6 +267,9 @@ namespace Jellyfin.Database.Providers.Sqlite.Migrations
|
||||
b.Property<string>("OfficialRating")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("OriginalLanguage")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("OriginalTitle")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
|
||||
@@ -267,6 +267,9 @@ namespace Jellyfin.Database.Providers.Sqlite.Migrations
|
||||
b.Property<string>("OfficialRating")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("OriginalLanguage")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("OriginalTitle")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,47 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Jellyfin.Database.Providers.Sqlite.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddOriginalLanguage : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsOriginal",
|
||||
table: "MediaStreamInfos",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "OriginalLanguage",
|
||||
table: "BaseItems",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "BaseItems",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("00000000-0000-0000-0000-000000000001"),
|
||||
column: "OriginalLanguage",
|
||||
value: null);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsOriginal",
|
||||
table: "MediaStreamInfos");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "OriginalLanguage",
|
||||
table: "BaseItems");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user