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.
69 lines
2.6 KiB
69 lines
2.6 KiB
using Microsoft.EntityFrameworkCore.Migrations; |
|
|
|
#nullable disable |
|
|
|
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
|
{ |
|
public partial class Add_PlayoutAnchorScheduleItemsEnumeratorState : Migration |
|
{ |
|
protected override void Up(MigrationBuilder migrationBuilder) |
|
{ |
|
migrationBuilder.DropForeignKey( |
|
name: "FK_PlayoutAnchor_ProgramScheduleItem_NextScheduleItemId", |
|
table: "PlayoutAnchor"); |
|
|
|
migrationBuilder.DropIndex( |
|
name: "IX_PlayoutAnchor_NextScheduleItemId", |
|
table: "PlayoutAnchor"); |
|
|
|
migrationBuilder.DropColumn( |
|
name: "NextScheduleItemId", |
|
table: "PlayoutAnchor"); |
|
|
|
migrationBuilder.CreateTable( |
|
name: "ScheduleItemsEnumeratorState", |
|
columns: table => new |
|
{ |
|
PlayoutAnchorPlayoutId = table.Column<int>(type: "INTEGER", nullable: false), |
|
Seed = table.Column<int>(type: "INTEGER", nullable: false), |
|
Index = table.Column<int>(type: "INTEGER", nullable: false) |
|
}, |
|
constraints: table => |
|
{ |
|
table.PrimaryKey("PK_ScheduleItemsEnumeratorState", x => x.PlayoutAnchorPlayoutId); |
|
table.ForeignKey( |
|
name: "FK_ScheduleItemsEnumeratorState_PlayoutAnchor_PlayoutAnchorPlayoutId", |
|
column: x => x.PlayoutAnchorPlayoutId, |
|
principalTable: "PlayoutAnchor", |
|
principalColumn: "PlayoutId", |
|
onDelete: ReferentialAction.Cascade); |
|
}); |
|
} |
|
|
|
protected override void Down(MigrationBuilder migrationBuilder) |
|
{ |
|
migrationBuilder.DropTable( |
|
name: "ScheduleItemsEnumeratorState"); |
|
|
|
migrationBuilder.AddColumn<int>( |
|
name: "NextScheduleItemId", |
|
table: "PlayoutAnchor", |
|
type: "INTEGER", |
|
nullable: false, |
|
defaultValue: 0); |
|
|
|
migrationBuilder.CreateIndex( |
|
name: "IX_PlayoutAnchor_NextScheduleItemId", |
|
table: "PlayoutAnchor", |
|
column: "NextScheduleItemId"); |
|
|
|
migrationBuilder.AddForeignKey( |
|
name: "FK_PlayoutAnchor_ProgramScheduleItem_NextScheduleItemId", |
|
table: "PlayoutAnchor", |
|
column: "NextScheduleItemId", |
|
principalTable: "ProgramScheduleItem", |
|
principalColumn: "Id", |
|
onDelete: ReferentialAction.Cascade); |
|
} |
|
} |
|
}
|
|
|