using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace ManagerService.Migrations { /// public partial class UpdateMapAnnotation : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_MapAnnotation_ResourceDTO_IconResourceDTOid", table: "MapAnnotation"); migrationBuilder.DropTable( name: "ResourceDTO"); migrationBuilder.RenameColumn( name: "IconResourceDTOid", table: "MapAnnotation", newName: "IconResourceId"); migrationBuilder.RenameIndex( name: "IX_MapAnnotation_IconResourceDTOid", table: "MapAnnotation", newName: "IX_MapAnnotation_IconResourceId"); migrationBuilder.AddForeignKey( name: "FK_MapAnnotation_Resources_IconResourceId", table: "MapAnnotation", column: "IconResourceId", principalTable: "Resources", principalColumn: "Id"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_MapAnnotation_Resources_IconResourceId", table: "MapAnnotation"); migrationBuilder.RenameColumn( name: "IconResourceId", table: "MapAnnotation", newName: "IconResourceDTOid"); migrationBuilder.RenameIndex( name: "IX_MapAnnotation_IconResourceId", table: "MapAnnotation", newName: "IX_MapAnnotation_IconResourceDTOid"); migrationBuilder.CreateTable( name: "ResourceDTO", columns: table => new { id = table.Column(type: "text", nullable: false), dateCreation = table.Column(type: "timestamp with time zone", nullable: false), instanceId = table.Column(type: "text", nullable: true), label = table.Column(type: "text", nullable: true), type = table.Column(type: "integer", nullable: false), url = table.Column(type: "text", nullable: true) }, constraints: table => { table.PrimaryKey("PK_ResourceDTO", x => x.id); }); migrationBuilder.AddForeignKey( name: "FK_MapAnnotation_ResourceDTO_IconResourceDTOid", table: "MapAnnotation", column: "IconResourceDTOid", principalTable: "ResourceDTO", principalColumn: "id"); } } }