Files
zentral/src/backend/Zentral.Infrastructure/Migrations/20251212122107_RemoveWarehouseProductGroups.cs

77 lines
3.1 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Zentral.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class RemoveWarehouseProductGroups : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_WarehouseArticles_WarehouseProductGroups_ProductGroupId",
table: "WarehouseArticles");
migrationBuilder.DropTable(
name: "WarehouseProductGroups");
migrationBuilder.DropIndex(
name: "IX_WarehouseArticles_ProductGroupId",
table: "WarehouseArticles");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "WarehouseProductGroups",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Code = table.Column<string>(type: "TEXT", nullable: false),
CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: true),
CreatedBy = table.Column<string>(type: "TEXT", nullable: true),
CustomFieldsJson = table.Column<string>(type: "TEXT", nullable: true),
Description = table.Column<string>(type: "TEXT", nullable: true),
IsActive = table.Column<bool>(type: "INTEGER", nullable: false),
Name = table.Column<string>(type: "TEXT", nullable: false),
Notes = table.Column<string>(type: "TEXT", nullable: true),
UpdatedAt = table.Column<DateTime>(type: "TEXT", nullable: true),
UpdatedBy = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_WarehouseProductGroups", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_WarehouseArticles_ProductGroupId",
table: "WarehouseArticles",
column: "ProductGroupId");
migrationBuilder.CreateIndex(
name: "IX_WarehouseProductGroups_Code",
table: "WarehouseProductGroups",
column: "Code",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_WarehouseProductGroups_IsActive",
table: "WarehouseProductGroups",
column: "IsActive");
migrationBuilder.AddForeignKey(
name: "FK_WarehouseArticles_WarehouseProductGroups_ProductGroupId",
table: "WarehouseArticles",
column: "ProductGroupId",
principalTable: "WarehouseProductGroups",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
}
}
}