manager-service/ManagerService/Migrations/20260612145724_AddSectionParcours.cs
2026-07-08 17:00:43 +02:00

185 lines
6.1 KiB
C#

using System.Collections.Generic;
using ManagerService.DTOs;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ManagerService.Migrations
{
/// <inheritdoc />
public partial class AddSectionParcours : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_GuidedPaths_Sections_SectionGameId",
table: "GuidedPaths");
migrationBuilder.RenameColumn(
name: "SectionGameId",
table: "GuidedPaths",
newName: "SectionParcoursId");
migrationBuilder.RenameIndex(
name: "IX_GuidedPaths_SectionGameId",
table: "GuidedPaths",
newName: "IX_GuidedPaths_SectionParcoursId");
migrationBuilder.AddColumn<bool>(
name: "IsGameMode",
table: "Sections",
type: "boolean",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "SectionParcours_BaseSectionMapId",
table: "Sections",
type: "text",
nullable: true);
migrationBuilder.AddColumn<List<TranslationAndResourceDTO>>(
name: "SectionParcours_GameMessageDebut",
table: "Sections",
type: "jsonb",
nullable: true);
migrationBuilder.AddColumn<List<TranslationAndResourceDTO>>(
name: "SectionParcours_GameMessageFin",
table: "Sections",
type: "jsonb",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "ShowMap",
table: "Sections",
type: "boolean",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "AudioIds",
table: "GuidedSteps",
type: "jsonb",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Contents",
table: "GuidedSteps",
type: "jsonb",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "FactContent",
table: "GuidedSteps",
type: "jsonb",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "EstimatedDurationMinutes",
table: "GuidedPaths",
type: "integer",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ImageResourceId",
table: "GuidedPaths",
type: "text",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_Sections_SectionParcours_BaseSectionMapId",
table: "Sections",
column: "SectionParcours_BaseSectionMapId");
migrationBuilder.AddForeignKey(
name: "FK_GuidedPaths_Sections_SectionParcoursId",
table: "GuidedPaths",
column: "SectionParcoursId",
principalTable: "Sections",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Sections_Sections_SectionParcours_BaseSectionMapId",
table: "Sections",
column: "SectionParcours_BaseSectionMapId",
principalTable: "Sections",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_GuidedPaths_Sections_SectionParcoursId",
table: "GuidedPaths");
migrationBuilder.DropForeignKey(
name: "FK_Sections_Sections_SectionParcours_BaseSectionMapId",
table: "Sections");
migrationBuilder.DropIndex(
name: "IX_Sections_SectionParcours_BaseSectionMapId",
table: "Sections");
migrationBuilder.DropColumn(
name: "IsGameMode",
table: "Sections");
migrationBuilder.DropColumn(
name: "SectionParcours_BaseSectionMapId",
table: "Sections");
migrationBuilder.DropColumn(
name: "SectionParcours_GameMessageDebut",
table: "Sections");
migrationBuilder.DropColumn(
name: "SectionParcours_GameMessageFin",
table: "Sections");
migrationBuilder.DropColumn(
name: "ShowMap",
table: "Sections");
migrationBuilder.DropColumn(
name: "AudioIds",
table: "GuidedSteps");
migrationBuilder.DropColumn(
name: "Contents",
table: "GuidedSteps");
migrationBuilder.DropColumn(
name: "FactContent",
table: "GuidedSteps");
migrationBuilder.DropColumn(
name: "EstimatedDurationMinutes",
table: "GuidedPaths");
migrationBuilder.DropColumn(
name: "ImageResourceId",
table: "GuidedPaths");
migrationBuilder.RenameColumn(
name: "SectionParcoursId",
table: "GuidedPaths",
newName: "SectionGameId");
migrationBuilder.RenameIndex(
name: "IX_GuidedPaths_SectionParcoursId",
table: "GuidedPaths",
newName: "IX_GuidedPaths_SectionGameId");
migrationBuilder.AddForeignKey(
name: "FK_GuidedPaths_Sections_SectionGameId",
table: "GuidedPaths",
column: "SectionGameId",
principalTable: "Sections",
principalColumn: "Id");
}
}
}