Files
ersatztv/ErsatzTV.Infrastructure.Sqlite/Migrations/20250804203715_Add_ChannelIsEnabled.cs
T
Jason DoveandGitHub b40ac9ef52 replace channel active mode with is enabled and show in epg (#2256)
* add channel enabled setting

* remove channel active mode
2025-08-04 21:24:26 +00:00

44 lines
1.3 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ErsatzTV.Infrastructure.Sqlite.Migrations
{
/// <inheritdoc />
public partial class Add_ChannelIsEnabled : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsEnabled",
table: "Channel",
type: "INTEGER",
nullable: false,
defaultValue: true);
migrationBuilder.AddColumn<bool>(
name: "ShowInEpg",
table: "Channel",
type: "INTEGER",
nullable: false,
defaultValue: true);
migrationBuilder.Sql("UPDATE `Channel` SET `IsEnabled` = 0 WHERE `ActiveMode` = 2");
migrationBuilder.Sql("UPDATE `Channel` SET `ShowInEpg` = 0 WHERE `ActiveMode` = 1");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsEnabled",
table: "Channel");
migrationBuilder.DropColumn(
name: "ShowInEpg",
table: "Channel");
}
}
}