Stream custom live channels using your own media
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

34 lines
1000 B

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ErsatzTV.Infrastructure.MySql.Migrations
{
/// <inheritdoc />
public partial class Add_ChannelSortNumber : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<double>(
name: "SortNumber",
table: "Channel",
type: "double",
nullable: false,
defaultValue: 0.0);
migrationBuilder.Sql(
@"UPDATE `Channel`
SET `SortNumber` = CAST(`Number` AS DECIMAL(10,2))
WHERE `Number` IS NOT NULL AND TRIM(`Number`) != ''");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "SortNumber",
table: "Channel");
}
}
}