141 lines
5.3 KiB
C#
141 lines
5.3 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace EgwCoreLib.Lux.Data.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class UpdateBuyOrderData : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_buy_order_row_sales_order_OrderID",
|
|
table: "buy_order_row");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_buy_order_row_OrderID",
|
|
table: "buy_order_row");
|
|
|
|
migrationBuilder.RenameColumn(
|
|
name: "OrderID",
|
|
table: "buy_order_row",
|
|
newName: "RowNum");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "buy_supplier_qualify",
|
|
columns: table => new
|
|
{
|
|
SupplierID = table.Column<int>(type: "int", nullable: false),
|
|
CodGroup = table.Column<string>(type: "varchar(255)", nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_buy_supplier_qualify", x => new { x.SupplierID, x.CodGroup });
|
|
table.ForeignKey(
|
|
name: "FK_buy_supplier_qualify_buy_supplier_SupplierID",
|
|
column: x => x.SupplierID,
|
|
principalTable: "buy_supplier",
|
|
principalColumn: "SupplierID",
|
|
onDelete: ReferentialAction.Restrict);
|
|
table.ForeignKey(
|
|
name: "FK_buy_supplier_qualify_item_group_CodGroup",
|
|
column: x => x.CodGroup,
|
|
principalTable: "item_group",
|
|
principalColumn: "CodGroup",
|
|
onDelete: ReferentialAction.Restrict);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "sales_offer",
|
|
keyColumn: "OfferID",
|
|
keyValue: 1,
|
|
column: "ValidUntil",
|
|
value: new DateTime(2026, 5, 14, 12, 24, 22, 268, DateTimeKind.Local).AddTicks(7042));
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "sales_offer",
|
|
keyColumn: "OfferID",
|
|
keyValue: 2,
|
|
column: "ValidUntil",
|
|
value: new DateTime(2026, 5, 14, 12, 24, 22, 268, DateTimeKind.Local).AddTicks(7058));
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "sales_offer",
|
|
keyColumn: "OfferID",
|
|
keyValue: 3,
|
|
column: "ValidUntil",
|
|
value: new DateTime(2026, 5, 14, 12, 24, 22, 268, DateTimeKind.Local).AddTicks(7064));
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "sales_offer",
|
|
keyColumn: "OfferID",
|
|
keyValue: 4,
|
|
column: "ValidUntil",
|
|
value: new DateTime(2026, 5, 14, 12, 24, 22, 268, DateTimeKind.Local).AddTicks(7071));
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_buy_supplier_qualify_CodGroup",
|
|
table: "buy_supplier_qualify",
|
|
column: "CodGroup");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "buy_supplier_qualify");
|
|
|
|
migrationBuilder.RenameColumn(
|
|
name: "RowNum",
|
|
table: "buy_order_row",
|
|
newName: "OrderID");
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "sales_offer",
|
|
keyColumn: "OfferID",
|
|
keyValue: 1,
|
|
column: "ValidUntil",
|
|
value: new DateTime(2026, 5, 14, 11, 22, 33, 792, DateTimeKind.Local).AddTicks(5680));
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "sales_offer",
|
|
keyColumn: "OfferID",
|
|
keyValue: 2,
|
|
column: "ValidUntil",
|
|
value: new DateTime(2026, 5, 14, 11, 22, 33, 792, DateTimeKind.Local).AddTicks(5692));
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "sales_offer",
|
|
keyColumn: "OfferID",
|
|
keyValue: 3,
|
|
column: "ValidUntil",
|
|
value: new DateTime(2026, 5, 14, 11, 22, 33, 792, DateTimeKind.Local).AddTicks(5699));
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "sales_offer",
|
|
keyColumn: "OfferID",
|
|
keyValue: 4,
|
|
column: "ValidUntil",
|
|
value: new DateTime(2026, 5, 14, 11, 22, 33, 792, DateTimeKind.Local).AddTicks(5705));
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_buy_order_row_OrderID",
|
|
table: "buy_order_row",
|
|
column: "OrderID");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_buy_order_row_sales_order_OrderID",
|
|
table: "buy_order_row",
|
|
column: "OrderID",
|
|
principalTable: "sales_order",
|
|
principalColumn: "OrderID",
|
|
onDelete: ReferentialAction.Restrict);
|
|
}
|
|
}
|
|
}
|