* start to add smart collections * add smart collection table; delete smart collection * overwrite smart collections * support scheduling smart collections * update changelog
45 lines
1.7 KiB
C#
45 lines
1.7 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
namespace ErsatzTV.Infrastructure.Migrations
|
|
{
|
|
public partial class Add_PlayoutProgramScheduleAnchorSmartCollection : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "SmartCollectionId",
|
|
table: "PlayoutProgramScheduleAnchor",
|
|
type: "INTEGER",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_PlayoutProgramScheduleAnchor_SmartCollectionId",
|
|
table: "PlayoutProgramScheduleAnchor",
|
|
column: "SmartCollectionId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_PlayoutProgramScheduleAnchor_SmartCollection_SmartCollectionId",
|
|
table: "PlayoutProgramScheduleAnchor",
|
|
column: "SmartCollectionId",
|
|
principalTable: "SmartCollection",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Restrict);
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_PlayoutProgramScheduleAnchor_SmartCollection_SmartCollectionId",
|
|
table: "PlayoutProgramScheduleAnchor");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_PlayoutProgramScheduleAnchor_SmartCollectionId",
|
|
table: "PlayoutProgramScheduleAnchor");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "SmartCollectionId",
|
|
table: "PlayoutProgramScheduleAnchor");
|
|
}
|
|
}
|
|
}
|