using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ErsatzTV.Infrastructure.Sqlite.Migrations
{
///
public partial class Add_ChannelPlayoutSource : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "MirrorSourceChannelId",
table: "Channel",
type: "INTEGER",
nullable: true);
migrationBuilder.AddColumn(
name: "PlayoutOffset",
table: "Channel",
type: "TEXT",
nullable: true);
migrationBuilder.AddColumn(
name: "PlayoutSource",
table: "Channel",
type: "INTEGER",
nullable: false,
defaultValue: 0);
migrationBuilder.CreateIndex(
name: "IX_Channel_MirrorSourceChannelId",
table: "Channel",
column: "MirrorSourceChannelId");
migrationBuilder.AddForeignKey(
name: "FK_Channel_Channel_MirrorSourceChannelId",
table: "Channel",
column: "MirrorSourceChannelId",
principalTable: "Channel",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Channel_Channel_MirrorSourceChannelId",
table: "Channel");
migrationBuilder.DropIndex(
name: "IX_Channel_MirrorSourceChannelId",
table: "Channel");
migrationBuilder.DropColumn(
name: "MirrorSourceChannelId",
table: "Channel");
migrationBuilder.DropColumn(
name: "PlayoutOffset",
table: "Channel");
migrationBuilder.DropColumn(
name: "PlayoutSource",
table: "Channel");
}
}
}