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 UpdateMix4 : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Categorie"); migrationBuilder.AddColumn>( name: "MapCategories", table: "Sections", type: "jsonb", nullable: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "MapCategories", table: "Sections"); migrationBuilder.CreateTable( name: "Categorie", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), ResourceId = table.Column(type: "text", nullable: true), Icon = table.Column(type: "text", nullable: true), Label = table.Column>(type: "jsonb", nullable: false), Order = table.Column(type: "integer", nullable: true), SectionMapId = table.Column(type: "text", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Categorie", x => x.Id); table.ForeignKey( name: "FK_Categorie_Resources_ResourceId", column: x => x.ResourceId, principalTable: "Resources", principalColumn: "Id"); table.ForeignKey( name: "FK_Categorie_Sections_SectionMapId", column: x => x.SectionMapId, principalTable: "Sections", principalColumn: "Id"); }); migrationBuilder.CreateIndex( name: "IX_Categorie_ResourceId", table: "Categorie", column: "ResourceId"); migrationBuilder.CreateIndex( name: "IX_Categorie_SectionMapId", table: "Categorie", column: "SectionMapId"); } } }