132 lines
6.7 KiB
C#
132 lines
6.7 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace ErsatzTV.Infrastructure.Sqlite.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddChannelTemplates : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "ChannelTemplate",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
|
.Annotation("Sqlite:Autoincrement", true),
|
|
Name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, collation: "NOCASE"),
|
|
Description = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: false, defaultValue: ""),
|
|
IsSystem = table.Column<bool>(type: "INTEGER", nullable: false),
|
|
FFmpegProfileId = table.Column<int>(type: "INTEGER", nullable: false),
|
|
WatermarkId = table.Column<int>(type: "INTEGER", nullable: true),
|
|
FallbackFillerId = table.Column<int>(type: "INTEGER", nullable: true),
|
|
PreRollFillerId = table.Column<int>(type: "INTEGER", nullable: true),
|
|
MidRollFillerId = table.Column<int>(type: "INTEGER", nullable: true),
|
|
PostRollFillerId = table.Column<int>(type: "INTEGER", nullable: true),
|
|
StreamSelectorMode = table.Column<int>(type: "INTEGER", nullable: false),
|
|
StreamSelector = table.Column<string>(type: "TEXT", nullable: true),
|
|
PreferredAudioLanguageCode = table.Column<string>(type: "TEXT", nullable: true),
|
|
PreferredAudioTitle = table.Column<string>(type: "TEXT", nullable: true),
|
|
PlayoutSource = table.Column<int>(type: "INTEGER", nullable: false),
|
|
PlayoutMode = table.Column<int>(type: "INTEGER", nullable: false),
|
|
StreamingMode = table.Column<int>(type: "INTEGER", nullable: false),
|
|
PreferredSubtitleLanguageCode = table.Column<string>(type: "TEXT", nullable: true),
|
|
SubtitleMode = table.Column<int>(type: "INTEGER", nullable: false),
|
|
MusicVideoCreditsMode = table.Column<int>(type: "INTEGER", nullable: false),
|
|
MusicVideoCreditsTemplate = table.Column<string>(type: "TEXT", nullable: true),
|
|
SongVideoMode = table.Column<int>(type: "INTEGER", nullable: false),
|
|
TranscodeMode = table.Column<int>(type: "INTEGER", nullable: false),
|
|
IdleBehavior = table.Column<int>(type: "INTEGER", nullable: false),
|
|
ShuffleScheduleItems = table.Column<bool>(type: "INTEGER", nullable: false),
|
|
RandomStartPoint = table.Column<bool>(type: "INTEGER", nullable: false),
|
|
FixedStartTimeBehavior = table.Column<int>(type: "INTEGER", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_ChannelTemplate", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_ChannelTemplate_ChannelWatermark_WatermarkId",
|
|
column: x => x.WatermarkId,
|
|
principalTable: "ChannelWatermark",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.SetNull);
|
|
table.ForeignKey(
|
|
name: "FK_ChannelTemplate_FFmpegProfile_FFmpegProfileId",
|
|
column: x => x.FFmpegProfileId,
|
|
principalTable: "FFmpegProfile",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Restrict);
|
|
table.ForeignKey(
|
|
name: "FK_ChannelTemplate_FillerPreset_FallbackFillerId",
|
|
column: x => x.FallbackFillerId,
|
|
principalTable: "FillerPreset",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.SetNull);
|
|
table.ForeignKey(
|
|
name: "FK_ChannelTemplate_FillerPreset_MidRollFillerId",
|
|
column: x => x.MidRollFillerId,
|
|
principalTable: "FillerPreset",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.SetNull);
|
|
table.ForeignKey(
|
|
name: "FK_ChannelTemplate_FillerPreset_PostRollFillerId",
|
|
column: x => x.PostRollFillerId,
|
|
principalTable: "FillerPreset",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.SetNull);
|
|
table.ForeignKey(
|
|
name: "FK_ChannelTemplate_FillerPreset_PreRollFillerId",
|
|
column: x => x.PreRollFillerId,
|
|
principalTable: "FillerPreset",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.SetNull);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_ChannelTemplate_FallbackFillerId",
|
|
table: "ChannelTemplate",
|
|
column: "FallbackFillerId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_ChannelTemplate_FFmpegProfileId",
|
|
table: "ChannelTemplate",
|
|
column: "FFmpegProfileId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_ChannelTemplate_MidRollFillerId",
|
|
table: "ChannelTemplate",
|
|
column: "MidRollFillerId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_ChannelTemplate_Name",
|
|
table: "ChannelTemplate",
|
|
column: "Name",
|
|
unique: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_ChannelTemplate_PostRollFillerId",
|
|
table: "ChannelTemplate",
|
|
column: "PostRollFillerId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_ChannelTemplate_PreRollFillerId",
|
|
table: "ChannelTemplate",
|
|
column: "PreRollFillerId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_ChannelTemplate_WatermarkId",
|
|
table: "ChannelTemplate",
|
|
column: "WatermarkId");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "ChannelTemplate");
|
|
}
|
|
}
|
|
}
|