This commit is contained in:
parent
4c345bd044
commit
4d40add598
13 changed files with 1722 additions and 12 deletions
|
@ -0,0 +1,66 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace Sledgemapper.Api.Migrations
|
||||
{
|
||||
public partial class renameMapToSession : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Maps_Campaigns_CampaignId1",
|
||||
table: "Maps");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Maps_CampaignId1",
|
||||
table: "Maps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CampaignId1",
|
||||
table: "Maps");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Sessions_CampaignId",
|
||||
table: "Sessions",
|
||||
column: "CampaignId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Sessions_Campaigns_CampaignId",
|
||||
table: "Sessions",
|
||||
column: "CampaignId",
|
||||
principalTable: "Campaigns",
|
||||
principalColumn: "CampaignId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Sessions_Campaigns_CampaignId",
|
||||
table: "Sessions");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Sessions_CampaignId",
|
||||
table: "Sessions");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "CampaignId1",
|
||||
table: "Maps",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Maps_CampaignId1",
|
||||
table: "Maps",
|
||||
column: "CampaignId1");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Maps_Campaigns_CampaignId1",
|
||||
table: "Maps",
|
||||
column: "CampaignId1",
|
||||
principalTable: "Campaigns",
|
||||
principalColumn: "CampaignId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue