mirror of https://github.com/ErsatzTV/ErsatzTV.git
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.
27 lines
953 B
27 lines
953 B
using Microsoft.EntityFrameworkCore.Migrations; |
|
|
|
namespace ErsatzTV.Infrastructure.Migrations |
|
{ |
|
public partial class Add_ProgramScheduleItemPlaybackOrder : Migration |
|
{ |
|
protected override void Up(MigrationBuilder migrationBuilder) |
|
{ |
|
migrationBuilder.AddColumn<int>( |
|
name: "PlaybackOrder", |
|
table: "ProgramScheduleItem", |
|
type: "INTEGER", |
|
nullable: false, |
|
defaultValue: 0); |
|
|
|
migrationBuilder.Sql( |
|
"UPDATE ProgramScheduleItem SET PlaybackOrder = (SELECT MediaCollectionPlaybackOrder FROM ProgramSchedule WHERE ProgramSchedule.Id = ProgramScheduleItem.ProgramScheduleId)"); |
|
} |
|
|
|
protected override void Down(MigrationBuilder migrationBuilder) |
|
{ |
|
migrationBuilder.DropColumn( |
|
name: "PlaybackOrder", |
|
table: "ProgramScheduleItem"); |
|
} |
|
} |
|
}
|
|
|