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.
42 lines
1.4 KiB
42 lines
1.4 KiB
using Microsoft.EntityFrameworkCore.Migrations; |
|
|
|
#nullable disable |
|
|
|
namespace ErsatzTV.Infrastructure.MySql.Migrations |
|
{ |
|
/// <inheritdoc /> |
|
public partial class Populate_PlayoutHistory_Finish : Migration |
|
{ |
|
/// <inheritdoc /> |
|
protected override void Up(MigrationBuilder migrationBuilder) |
|
{ |
|
migrationBuilder.CreateIndex( |
|
name: "IX_PlayoutItem_PlayoutId_Start", |
|
table: "PlayoutItem", |
|
columns: new[] { "PlayoutId", "Start" }); |
|
|
|
migrationBuilder.CreateIndex( |
|
name: "IX_PlayoutHistory_PlayoutId_When", |
|
table: "PlayoutHistory", |
|
columns: new[] { "PlayoutId", "When" }); |
|
|
|
migrationBuilder.Sql( |
|
@"UPDATE PlayoutHistory |
|
JOIN PlayoutItem ON PlayoutHistory.PlayoutId = PlayoutItem.PlayoutId AND PlayoutHistory.`When` = PlayoutItem.Start |
|
SET PlayoutHistory.Finish = PlayoutItem.Finish"); |
|
|
|
migrationBuilder.DropIndex( |
|
name: "IX_PlayoutItem_PlayoutId_Start", |
|
table: "PlayoutItem"); |
|
|
|
migrationBuilder.DropIndex( |
|
name: "IX_PlayoutHistory_PlayoutId_When", |
|
table: "PlayoutHistory"); |
|
} |
|
|
|
/// <inheritdoc /> |
|
protected override void Down(MigrationBuilder migrationBuilder) |
|
{ |
|
} |
|
} |
|
}
|
|
|