20260205075804_Migration_20260205155753.cs 9.72 KB
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Rcs.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class Migration_20260205155753 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "description",
                table: "step_properties");

            migrationBuilder.DropColumn(
                name: "extra_properties",
                table: "step_properties");

            migrationBuilder.DropColumn(
                name: "request_method",
                table: "step_properties");

            migrationBuilder.DropColumn(
                name: "request_params",
                table: "step_properties");

            migrationBuilder.DropColumn(
                name: "request_url",
                table: "step_properties");

            migrationBuilder.DropColumn(
                name: "response_validation_rule",
                table: "step_properties");

            migrationBuilder.DropColumn(
                name: "wait_response_flag",
                table: "step_properties");

            migrationBuilder.RenameColumn(
                name: "repeat_count",
                table: "step_properties",
                newName: "pre_action2_type");

            migrationBuilder.RenameColumn(
                name: "interval_time_ms",
                table: "step_properties",
                newName: "pre_action1_type");

            migrationBuilder.RenameColumn(
                name: "after_action_type",
                table: "step_properties",
                newName: "post_action2_type");

            migrationBuilder.AddColumn<int>(
                name: "post_action1_type",
                table: "step_properties",
                type: "integer",
                nullable: true);

            migrationBuilder.AddColumn<List<Guid>>(
                name: "post_net_actions1",
                table: "step_properties",
                type: "jsonb",
                nullable: true);

            migrationBuilder.AddColumn<List<Guid>>(
                name: "post_net_actions2",
                table: "step_properties",
                type: "jsonb",
                nullable: true);

            migrationBuilder.AddColumn<List<Guid>>(
                name: "pre_net_actions1",
                table: "step_properties",
                type: "jsonb",
                nullable: true);

            migrationBuilder.AddColumn<List<Guid>>(
                name: "pre_net_actions2",
                table: "step_properties",
                type: "jsonb",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "post_action1_type",
                table: "map_resources",
                type: "integer",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "post_action2_type",
                table: "map_resources",
                type: "integer",
                nullable: true);

            migrationBuilder.AddColumn<List<Guid>>(
                name: "post_net_actions1",
                table: "map_resources",
                type: "jsonb",
                nullable: true);

            migrationBuilder.AddColumn<List<Guid>>(
                name: "post_net_actions2",
                table: "map_resources",
                type: "jsonb",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "pre_action1_type",
                table: "map_resources",
                type: "integer",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "pre_action2_type",
                table: "map_resources",
                type: "integer",
                nullable: true);

            migrationBuilder.AddColumn<List<Guid>>(
                name: "pre_net_actions1",
                table: "map_resources",
                type: "jsonb",
                nullable: true);

            migrationBuilder.AddColumn<List<Guid>>(
                name: "pre_net_actions2",
                table: "map_resources",
                type: "jsonb",
                nullable: true);

            migrationBuilder.CreateTable(
                name: "net_action_propertys",
                columns: table => new
                {
                    net_action_id = table.Column<Guid>(type: "uuid", nullable: false),
                    request_method = table.Column<string>(type: "character varying(10)", maxLength: 10, nullable: true),
                    request_url = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: true),
                    request_params = table.Column<string>(type: "text", nullable: true),
                    repeat_count = table.Column<int>(type: "integer", nullable: true),
                    interval_time_ms = table.Column<int>(type: "integer", nullable: true),
                    wait_response_flag = table.Column<string>(type: "character varying(1)", maxLength: 1, nullable: true),
                    response_validation_rule = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: true),
                    description = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: true),
                    extra_properties = table.Column<string>(type: "text", nullable: true),
                    created_at = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
                    updated_at = table.Column<DateTime>(type: "timestamp without time zone", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_net_action_propertys", x => x.net_action_id);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "net_action_propertys");

            migrationBuilder.DropColumn(
                name: "post_action1_type",
                table: "step_properties");

            migrationBuilder.DropColumn(
                name: "post_net_actions1",
                table: "step_properties");

            migrationBuilder.DropColumn(
                name: "post_net_actions2",
                table: "step_properties");

            migrationBuilder.DropColumn(
                name: "pre_net_actions1",
                table: "step_properties");

            migrationBuilder.DropColumn(
                name: "pre_net_actions2",
                table: "step_properties");

            migrationBuilder.DropColumn(
                name: "post_action1_type",
                table: "map_resources");

            migrationBuilder.DropColumn(
                name: "post_action2_type",
                table: "map_resources");

            migrationBuilder.DropColumn(
                name: "post_net_actions1",
                table: "map_resources");

            migrationBuilder.DropColumn(
                name: "post_net_actions2",
                table: "map_resources");

            migrationBuilder.DropColumn(
                name: "pre_action1_type",
                table: "map_resources");

            migrationBuilder.DropColumn(
                name: "pre_action2_type",
                table: "map_resources");

            migrationBuilder.DropColumn(
                name: "pre_net_actions1",
                table: "map_resources");

            migrationBuilder.DropColumn(
                name: "pre_net_actions2",
                table: "map_resources");

            migrationBuilder.RenameColumn(
                name: "pre_action2_type",
                table: "step_properties",
                newName: "repeat_count");

            migrationBuilder.RenameColumn(
                name: "pre_action1_type",
                table: "step_properties",
                newName: "interval_time_ms");

            migrationBuilder.RenameColumn(
                name: "post_action2_type",
                table: "step_properties",
                newName: "after_action_type");

            migrationBuilder.AddColumn<string>(
                name: "description",
                table: "step_properties",
                type: "character varying(500)",
                maxLength: 500,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "extra_properties",
                table: "step_properties",
                type: "text",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "request_method",
                table: "step_properties",
                type: "character varying(10)",
                maxLength: 10,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "request_params",
                table: "step_properties",
                type: "text",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "request_url",
                table: "step_properties",
                type: "character varying(500)",
                maxLength: 500,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "response_validation_rule",
                table: "step_properties",
                type: "character varying(200)",
                maxLength: 200,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "wait_response_flag",
                table: "step_properties",
                type: "character varying(1)",
                maxLength: 1,
                nullable: true);
        }
    }
}