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.
44 lines
1.6 KiB
44 lines
1.6 KiB
using Microsoft.EntityFrameworkCore.Migrations; |
|
|
|
namespace ErsatzTV.Infrastructure.Migrations |
|
{ |
|
public partial class Add_ProgramScheduleItemSmartCollection : Migration |
|
{ |
|
protected override void Up(MigrationBuilder migrationBuilder) |
|
{ |
|
migrationBuilder.AddColumn<int>( |
|
name: "SmartCollectionId", |
|
table: "ProgramScheduleItem", |
|
type: "INTEGER", |
|
nullable: true); |
|
|
|
migrationBuilder.CreateIndex( |
|
name: "IX_ProgramScheduleItem_SmartCollectionId", |
|
table: "ProgramScheduleItem", |
|
column: "SmartCollectionId"); |
|
|
|
migrationBuilder.AddForeignKey( |
|
name: "FK_ProgramScheduleItem_SmartCollection_SmartCollectionId", |
|
table: "ProgramScheduleItem", |
|
column: "SmartCollectionId", |
|
principalTable: "SmartCollection", |
|
principalColumn: "Id", |
|
onDelete: ReferentialAction.Restrict); |
|
} |
|
|
|
protected override void Down(MigrationBuilder migrationBuilder) |
|
{ |
|
migrationBuilder.DropForeignKey( |
|
name: "FK_ProgramScheduleItem_SmartCollection_SmartCollectionId", |
|
table: "ProgramScheduleItem"); |
|
|
|
migrationBuilder.DropIndex( |
|
name: "IX_ProgramScheduleItem_SmartCollectionId", |
|
table: "ProgramScheduleItem"); |
|
|
|
migrationBuilder.DropColumn( |
|
name: "SmartCollectionId", |
|
table: "ProgramScheduleItem"); |
|
} |
|
} |
|
}
|
|
|