Files
ersatztv/ErsatzTV.Infrastructure/Migrations/20211025124549_Add_ChannelFallbackFiller.cs
T
Jason DoveandGitHub 0136de700c add global and channel fallback filler (#459)
* configure channel and global fallback filler

* play random item from configured channel/global fallback filler as needed
2021-10-30 11:45:40 -05:00

69 lines
2.3 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
namespace ErsatzTV.Infrastructure.Migrations
{
public partial class Add_ChannelFallbackFiller : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Channel_ChannelWatermark_WatermarkId",
table: "Channel");
migrationBuilder.AddColumn<int>(
name: "FallbackFillerId",
table: "Channel",
type: "INTEGER",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_Channel_FallbackFillerId",
table: "Channel",
column: "FallbackFillerId");
migrationBuilder.AddForeignKey(
name: "FK_Channel_ChannelWatermark_WatermarkId",
table: "Channel",
column: "WatermarkId",
principalTable: "ChannelWatermark",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey(
name: "FK_Channel_FillerPreset_FallbackFillerId",
table: "Channel",
column: "FallbackFillerId",
principalTable: "FillerPreset",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Channel_ChannelWatermark_WatermarkId",
table: "Channel");
migrationBuilder.DropForeignKey(
name: "FK_Channel_FillerPreset_FallbackFillerId",
table: "Channel");
migrationBuilder.DropIndex(
name: "IX_Channel_FallbackFillerId",
table: "Channel");
migrationBuilder.DropColumn(
name: "FallbackFillerId",
table: "Channel");
migrationBuilder.AddForeignKey(
name: "FK_Channel_ChannelWatermark_WatermarkId",
table: "Channel",
column: "WatermarkId",
principalTable: "ChannelWatermark",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
}
}