using System.Collections.Generic;
using ManagerService.DTOs;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ManagerService.Migrations
{
///
public partial class AddSectionParcours : Migration
{
///
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(
name: "IsGameMode",
table: "Sections",
type: "boolean",
nullable: true);
migrationBuilder.AddColumn(
name: "SectionParcours_BaseSectionMapId",
table: "Sections",
type: "text",
nullable: true);
migrationBuilder.AddColumn>(
name: "SectionParcours_GameMessageDebut",
table: "Sections",
type: "jsonb",
nullable: true);
migrationBuilder.AddColumn>(
name: "SectionParcours_GameMessageFin",
table: "Sections",
type: "jsonb",
nullable: true);
migrationBuilder.AddColumn(
name: "ShowMap",
table: "Sections",
type: "boolean",
nullable: true);
migrationBuilder.AddColumn(
name: "AudioIds",
table: "GuidedSteps",
type: "jsonb",
nullable: true);
migrationBuilder.AddColumn(
name: "Contents",
table: "GuidedSteps",
type: "jsonb",
nullable: true);
migrationBuilder.AddColumn(
name: "FactContent",
table: "GuidedSteps",
type: "jsonb",
nullable: true);
migrationBuilder.AddColumn(
name: "EstimatedDurationMinutes",
table: "GuidedPaths",
type: "integer",
nullable: true);
migrationBuilder.AddColumn(
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);
}
///
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");
}
}
}