Files
Backend-Api/CompanyManagment.EFCore/Migrations/20251120104018_add dynamic deduction to customize checkouts.cs

69 lines
3.3 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class adddynamicdeductiontocustomizecheckouts : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "CustomizeCheckouts_CheckoutDynamicDeductions",
columns: table => new
{
CustomizeCheckoutid = table.Column<long>(type: "bigint", nullable: false),
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
Count = table.Column<int>(type: "int", nullable: false),
Amount = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_CustomizeCheckouts_CheckoutDynamicDeductions", x => new { x.CustomizeCheckoutid, x.Id });
table.ForeignKey(
name: "FK_CustomizeCheckouts_CheckoutDynamicDeductions_CustomizeCheckouts_CustomizeCheckoutid",
column: x => x.CustomizeCheckoutid,
principalTable: "CustomizeCheckouts",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "CustomizeCheckoutTemps_CheckoutDynamicDeductions",
columns: table => new
{
CustomizeCheckoutTempid = table.Column<long>(type: "bigint", nullable: false),
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
Count = table.Column<int>(type: "int", nullable: false),
Amount = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_CustomizeCheckoutTemps_CheckoutDynamicDeductions", x => new { x.CustomizeCheckoutTempid, x.Id });
table.ForeignKey(
name: "FK_CustomizeCheckoutTemps_CheckoutDynamicDeductions_CustomizeCheckoutTemps_CustomizeCheckoutTempid",
column: x => x.CustomizeCheckoutTempid,
principalTable: "CustomizeCheckoutTemps",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CustomizeCheckouts_CheckoutDynamicDeductions");
migrationBuilder.DropTable(
name: "CustomizeCheckoutTemps_CheckoutDynamicDeductions");
}
}
}