mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-24 02:02:29 -04:00
* Migrate keyframe data into database * Clear database table before import to handle failed migrations
42 lines
1.4 KiB
C#
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");
|
|
}
|
|
}
|
|
}
|