using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace CutList.Web.Migrations { /// public partial class AddPriceTrackingToTransactions : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "SupplierId", table: "StockTransactions", type: "int", nullable: true); migrationBuilder.AddColumn( name: "UnitPrice", table: "StockTransactions", type: "decimal(10,2)", precision: 10, scale: 2, nullable: true); migrationBuilder.CreateIndex( name: "IX_StockTransactions_SupplierId", table: "StockTransactions", column: "SupplierId"); migrationBuilder.AddForeignKey( name: "FK_StockTransactions_Suppliers_SupplierId", table: "StockTransactions", column: "SupplierId", principalTable: "Suppliers", principalColumn: "Id", onDelete: ReferentialAction.SetNull); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_StockTransactions_Suppliers_SupplierId", table: "StockTransactions"); migrationBuilder.DropIndex( name: "IX_StockTransactions_SupplierId", table: "StockTransactions"); migrationBuilder.DropColumn( name: "SupplierId", table: "StockTransactions"); migrationBuilder.DropColumn( name: "UnitPrice", table: "StockTransactions"); } } }