using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Data.SeaHavenIndustries.Migrations { /// public partial class AddDropdownOptionsAndWOFields : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "CompletedDate", table: "workOrders", type: "datetime2", nullable: true); migrationBuilder.AddColumn( name: "Problem", table: "workOrders", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "ScheduledDate", table: "workOrders", type: "datetime2", nullable: true); migrationBuilder.AddColumn( name: "Source", table: "workOrders", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "SubTrade", table: "workOrders", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "Trade", table: "workOrders", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "VendorNTE", table: "workOrders", type: "decimal(18,2)", nullable: true); migrationBuilder.CreateTable( name: "DropdownOptions", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Category = table.Column(type: "nvarchar(max)", nullable: false), Value = table.Column(type: "nvarchar(max)", nullable: false), ParentValue = table.Column(type: "nvarchar(max)", nullable: true), SortOrder = table.Column(type: "int", nullable: false), IsActive = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_DropdownOptions", x => x.Id); }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "DropdownOptions"); migrationBuilder.DropColumn( name: "CompletedDate", table: "workOrders"); migrationBuilder.DropColumn( name: "Problem", table: "workOrders"); migrationBuilder.DropColumn( name: "ScheduledDate", table: "workOrders"); migrationBuilder.DropColumn( name: "Source", table: "workOrders"); migrationBuilder.DropColumn( name: "SubTrade", table: "workOrders"); migrationBuilder.DropColumn( name: "Trade", table: "workOrders"); migrationBuilder.DropColumn( name: "VendorNTE", table: "workOrders"); } } }