using System.Collections.Generic;
using ManagerService.Data.SubSection;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace ManagerService.Migrations
{
///
public partial class UpdateMix5 : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "OrderedTranslationAndResource");
migrationBuilder.AddColumn>(
name: "PDFOrderedTranslationAndResources",
table: "Sections",
type: "jsonb",
nullable: true);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "PDFOrderedTranslationAndResources",
table: "Sections");
migrationBuilder.CreateTable(
name: "OrderedTranslationAndResource",
columns: table => new
{
Id = table.Column(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Order = table.Column(type: "integer", nullable: false),
SectionPdfId = table.Column(type: "text", nullable: true),
TranslationAndResources = table.Column>(type: "jsonb", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_OrderedTranslationAndResource", x => x.Id);
table.ForeignKey(
name: "FK_OrderedTranslationAndResource_Sections_SectionPdfId",
column: x => x.SectionPdfId,
principalTable: "Sections",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_OrderedTranslationAndResource_SectionPdfId",
table: "OrderedTranslationAndResource",
column: "SectionPdfId");
}
}
}