using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Data.SeaHavenIndustries.Migrations { /// public partial class AddDispatchChecklist : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "DispatchChecklistItems", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), DispatchId = table.Column(type: "int", nullable: false), WorkOrderId = table.Column(type: "int", nullable: true), ItemText = table.Column(type: "nvarchar(max)", nullable: true), IsCompleted = table.Column(type: "bit", nullable: false), CompletedBy = table.Column(type: "nvarchar(max)", nullable: true), CompletedAt = table.Column(type: "datetime2", nullable: true), SortOrder = table.Column(type: "int", nullable: false), IsDeleted = table.Column(type: "bit", nullable: true), createdby = table.Column(type: "nvarchar(max)", nullable: true), DeleterUserId = table.Column(type: "nvarchar(max)", nullable: true), DeletionTime = table.Column(type: "datetime2", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierUserId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_DispatchChecklistItems", x => x.Id); table.ForeignKey( name: "FK_DispatchChecklistItems_Dispatches_DispatchId", column: x => x.DispatchId, principalTable: "Dispatches", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_DispatchChecklistItems_workOrders_WorkOrderId", column: x => x.WorkOrderId, principalTable: "workOrders", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_DispatchChecklistItems_DispatchId", table: "DispatchChecklistItems", column: "DispatchId"); migrationBuilder.CreateIndex( name: "IX_DispatchChecklistItems_WorkOrderId", table: "DispatchChecklistItems", column: "WorkOrderId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "DispatchChecklistItems"); } } }