using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace PARR.DAL.Migrations { /// public partial class removeWorks : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_ApplicationsInWorks_Works_WorkId", table: "ApplicationsInWorks"); migrationBuilder.DropTable( name: "Works"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Works", columns: table => new { Id = table.Column(type: "uuid", nullable: false), TnkId = table.Column(type: "uuid", nullable: false), DateCreated = table.Column(type: "timestamp with time zone", nullable: false), DateModified = table.Column(type: "timestamp with time zone", nullable: true), EsppId = table.Column(type: "integer", nullable: false), Name = table.Column(type: "text", nullable: false), TemplateNameMask = table.Column(type: "text", nullable: false), TemplateSuffix = table.Column(type: "text", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Works", x => x.Id); table.ForeignKey( name: "FK_Works_Tnks_TnkId", column: x => x.TnkId, principalTable: "Tnks", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_Works_EsppId", table: "Works", column: "EsppId", unique: true); migrationBuilder.CreateIndex( name: "IX_Works_TnkId", table: "Works", column: "TnkId"); migrationBuilder.AddForeignKey( name: "FK_ApplicationsInWorks_Works_WorkId", table: "ApplicationsInWorks", column: "WorkId", principalTable: "Works", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } } }