20260327035652_Migration_20260327115644.cs 5.75 KB
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Rcs.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class Migration_20260327115644 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<Guid>(
                name: "drop_apply_request_config_id",
                table: "storage_location_types",
                type: "uuid",
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "drop_complete_request_config_id",
                table: "storage_location_types",
                type: "uuid",
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "pickup_apply_request_config_id",
                table: "storage_location_types",
                type: "uuid",
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "pickup_complete_request_config_id",
                table: "storage_location_types",
                type: "uuid",
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "idx_storage_location_type_drop_apply_request_config_id",
                table: "storage_location_types",
                column: "drop_apply_request_config_id");

            migrationBuilder.CreateIndex(
                name: "idx_storage_location_type_drop_complete_request_config_id",
                table: "storage_location_types",
                column: "drop_complete_request_config_id");

            migrationBuilder.CreateIndex(
                name: "idx_storage_location_type_pickup_apply_request_config_id",
                table: "storage_location_types",
                column: "pickup_apply_request_config_id");

            migrationBuilder.CreateIndex(
                name: "idx_storage_location_type_pickup_complete_request_config_id",
                table: "storage_location_types",
                column: "pickup_complete_request_config_id");

            migrationBuilder.AddForeignKey(
                name: "FK_storage_location_types_net_action_propertys_drop_apply_requ~",
                table: "storage_location_types",
                column: "drop_apply_request_config_id",
                principalTable: "net_action_propertys",
                principalColumn: "net_action_id",
                onDelete: ReferentialAction.SetNull);

            migrationBuilder.AddForeignKey(
                name: "FK_storage_location_types_net_action_propertys_drop_complete_r~",
                table: "storage_location_types",
                column: "drop_complete_request_config_id",
                principalTable: "net_action_propertys",
                principalColumn: "net_action_id",
                onDelete: ReferentialAction.SetNull);

            migrationBuilder.AddForeignKey(
                name: "FK_storage_location_types_net_action_propertys_pickup_apply_re~",
                table: "storage_location_types",
                column: "pickup_apply_request_config_id",
                principalTable: "net_action_propertys",
                principalColumn: "net_action_id",
                onDelete: ReferentialAction.SetNull);

            migrationBuilder.AddForeignKey(
                name: "FK_storage_location_types_net_action_propertys_pickup_complete~",
                table: "storage_location_types",
                column: "pickup_complete_request_config_id",
                principalTable: "net_action_propertys",
                principalColumn: "net_action_id",
                onDelete: ReferentialAction.SetNull);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_storage_location_types_net_action_propertys_drop_apply_requ~",
                table: "storage_location_types");

            migrationBuilder.DropForeignKey(
                name: "FK_storage_location_types_net_action_propertys_drop_complete_r~",
                table: "storage_location_types");

            migrationBuilder.DropForeignKey(
                name: "FK_storage_location_types_net_action_propertys_pickup_apply_re~",
                table: "storage_location_types");

            migrationBuilder.DropForeignKey(
                name: "FK_storage_location_types_net_action_propertys_pickup_complete~",
                table: "storage_location_types");

            migrationBuilder.DropIndex(
                name: "idx_storage_location_type_drop_apply_request_config_id",
                table: "storage_location_types");

            migrationBuilder.DropIndex(
                name: "idx_storage_location_type_drop_complete_request_config_id",
                table: "storage_location_types");

            migrationBuilder.DropIndex(
                name: "idx_storage_location_type_pickup_apply_request_config_id",
                table: "storage_location_types");

            migrationBuilder.DropIndex(
                name: "idx_storage_location_type_pickup_complete_request_config_id",
                table: "storage_location_types");

            migrationBuilder.DropColumn(
                name: "drop_apply_request_config_id",
                table: "storage_location_types");

            migrationBuilder.DropColumn(
                name: "drop_complete_request_config_id",
                table: "storage_location_types");

            migrationBuilder.DropColumn(
                name: "pickup_apply_request_config_id",
                table: "storage_location_types");

            migrationBuilder.DropColumn(
                name: "pickup_complete_request_config_id",
                table: "storage_location_types");
        }
    }
}