Tim Eisele 0573999d5e
Import Keyframes into database (#13771)
* Migrate keyframe data into database

* Clear database table before import to handle failed migrations
2025-04-02 18:06:40 -06:00

42 lines
1.4 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Jellyfin.Server.Implementations.Migrations
{
/// <inheritdoc />
public partial class AddKeyframeData : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "KeyframeData",
columns: table => new
{
ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
TotalDuration = table.Column<long>(type: "INTEGER", nullable: false),
KeyframeTicks = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_KeyframeData", x => x.ItemId);
table.ForeignKey(
name: "FK_KeyframeData_BaseItems_ItemId",
column: x => x.ItemId,
principalTable: "BaseItems",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "KeyframeData");
}
}
}