manager-service/ManagerService/Migrations/20251121142433_UpdatePuzzleToGame.cs
2025-11-27 16:19:00 +01:00

151 lines
4.8 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ManagerService.Migrations
{
/// <inheritdoc />
public partial class UpdatePuzzleToGame : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Sections_Resources_PuzzleImageId",
table: "Sections");
migrationBuilder.DropColumn(
name: "IsSlidingPuzzle",
table: "Sections");
migrationBuilder.RenameColumn(
name: "PuzzleRows",
table: "Sections",
newName: "GameType");
migrationBuilder.RenameColumn(
name: "PuzzleMessageFin",
table: "Sections",
newName: "GameMessageFin");
migrationBuilder.RenameColumn(
name: "PuzzleMessageDebut",
table: "Sections",
newName: "GameMessageDebut");
migrationBuilder.RenameColumn(
name: "PuzzleImageId",
table: "Sections",
newName: "GamePuzzleImageId");
migrationBuilder.RenameColumn(
name: "PuzzleCols",
table: "Sections",
newName: "GamePuzzleRows");
migrationBuilder.RenameIndex(
name: "IX_Sections_PuzzleImageId",
table: "Sections",
newName: "IX_Sections_GamePuzzleImageId");
migrationBuilder.AddColumn<int>(
name: "GamePuzzleCols",
table: "Sections",
type: "integer",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "SectionGameId",
table: "GuidedPaths",
type: "text",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_GuidedPaths_SectionGameId",
table: "GuidedPaths",
column: "SectionGameId");
migrationBuilder.AddForeignKey(
name: "FK_GuidedPaths_Sections_SectionGameId",
table: "GuidedPaths",
column: "SectionGameId",
principalTable: "Sections",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Sections_Resources_GamePuzzleImageId",
table: "Sections",
column: "GamePuzzleImageId",
principalTable: "Resources",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_GuidedPaths_Sections_SectionGameId",
table: "GuidedPaths");
migrationBuilder.DropForeignKey(
name: "FK_Sections_Resources_GamePuzzleImageId",
table: "Sections");
migrationBuilder.DropIndex(
name: "IX_GuidedPaths_SectionGameId",
table: "GuidedPaths");
migrationBuilder.DropColumn(
name: "GamePuzzleCols",
table: "Sections");
migrationBuilder.DropColumn(
name: "SectionGameId",
table: "GuidedPaths");
migrationBuilder.RenameColumn(
name: "GameType",
table: "Sections",
newName: "PuzzleRows");
migrationBuilder.RenameColumn(
name: "GamePuzzleRows",
table: "Sections",
newName: "PuzzleCols");
migrationBuilder.RenameColumn(
name: "GamePuzzleImageId",
table: "Sections",
newName: "PuzzleImageId");
migrationBuilder.RenameColumn(
name: "GameMessageFin",
table: "Sections",
newName: "PuzzleMessageFin");
migrationBuilder.RenameColumn(
name: "GameMessageDebut",
table: "Sections",
newName: "PuzzleMessageDebut");
migrationBuilder.RenameIndex(
name: "IX_Sections_GamePuzzleImageId",
table: "Sections",
newName: "IX_Sections_PuzzleImageId");
migrationBuilder.AddColumn<bool>(
name: "IsSlidingPuzzle",
table: "Sections",
type: "boolean",
nullable: true);
migrationBuilder.AddForeignKey(
name: "FK_Sections_Resources_PuzzleImageId",
table: "Sections",
column: "PuzzleImageId",
principalTable: "Resources",
principalColumn: "Id");
}
}
}