Files
ersatztv/ErsatzTV.Infrastructure.Sqlite/Migrations/20250726171343_Update_MediaFilePathHash.cs
T
Jason DoveandGitHub ab0f431c85 fix app startup with mysql (#2205)
* don't run pragma command on mysql

* add not required pathhash

* make media file path hash required

* update changelog
2025-07-26 17:48:03 +00:00

47 lines
1.3 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ErsatzTV.Infrastructure.Sqlite.Migrations
{
/// <inheritdoc />
public partial class Update_MediaFilePathHash : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "PathHash",
table: "MediaFile",
type: "TEXT",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.CreateIndex(
name: "IX_MediaFile_PathHash",
table: "MediaFile",
column: "PathHash",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_MediaFile_PathHash",
table: "MediaFile");
migrationBuilder.AlterColumn<string>(
name: "PathHash",
table: "MediaFile",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT");
}
}
}