Updated Migrations

Updated Migrations to handle change of Int to Long (SQLite still uses
integer field, but better safe if using something other then SQLite)
Changed Primary Key for Video from VideoId to PlaylistItemId.
This commit is contained in:
Mario Steele 2025-07-19 12:47:24 -05:00
parent 6970b792eb
commit 8e11008d58
5 changed files with 565 additions and 14 deletions

View file

@ -0,0 +1,36 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace FreeTubeSync.Migrations
{
/// <inheritdoc />
public partial class ChangePrimaryKeyToPlaylistItemId : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropPrimaryKey(
name: "PK_Videos",
table: "Videos");
migrationBuilder.AddPrimaryKey(
name: "PK_Videos",
table: "Videos",
column: "playlistItemId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropPrimaryKey(
name: "PK_Videos",
table: "Videos");
migrationBuilder.AddPrimaryKey(
name: "PK_Videos",
table: "Videos",
column: "videoId");
}
}
}