You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
165 lines
7.9 KiB
165 lines
7.9 KiB
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace X1.Infrastructure.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddTestCaseFlowTables : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "tb_testcaseflow",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<string>(type: "character varying(450)", maxLength: 450, nullable: false),
|
|
name = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false),
|
|
description = table.Column<string>(type: "character varying(1000)", maxLength: 1000, nullable: true),
|
|
type = table.Column<int>(type: "integer", nullable: false),
|
|
isenabled = table.Column<bool>(type: "boolean", nullable: false),
|
|
viewport_x = table.Column<double>(type: "double precision", nullable: false),
|
|
viewport_y = table.Column<double>(type: "double precision", nullable: false),
|
|
viewport_zoom = table.Column<double>(type: "double precision", nullable: false),
|
|
createdat = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|
updatedat = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|
createdby = table.Column<string>(type: "character varying(450)", maxLength: 450, nullable: false),
|
|
updatedby = table.Column<string>(type: "character varying(450)", maxLength: 450, nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_tb_testcaseflow", x => x.id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "tb_testcaseedge",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<string>(type: "character varying(450)", maxLength: 450, nullable: false),
|
|
testcaseid = table.Column<string>(type: "character varying(450)", maxLength: 450, nullable: false),
|
|
edgeid = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
|
|
sourcenodeid = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
|
|
targetnodeid = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
|
|
edgetype = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
|
|
condition = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: true),
|
|
isanimated = table.Column<bool>(type: "boolean", nullable: false),
|
|
style = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_tb_testcaseedge", x => x.id);
|
|
table.ForeignKey(
|
|
name: "FK_tb_testcaseedge_tb_testcaseflow_testcaseid",
|
|
column: x => x.testcaseid,
|
|
principalTable: "tb_testcaseflow",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "tb_testcasenode",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<string>(type: "character varying(450)", maxLength: 450, nullable: false),
|
|
testcaseid = table.Column<string>(type: "character varying(450)", maxLength: 450, nullable: false),
|
|
nodeid = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
|
|
sequencenumber = table.Column<int>(type: "integer", nullable: false),
|
|
stepid = table.Column<string>(type: "character varying(450)", maxLength: 450, nullable: true),
|
|
positionx = table.Column<double>(type: "double precision", nullable: false),
|
|
positiony = table.Column<double>(type: "double precision", nullable: false),
|
|
width = table.Column<double>(type: "double precision", nullable: false),
|
|
height = table.Column<double>(type: "double precision", nullable: false),
|
|
isselected = table.Column<bool>(type: "boolean", nullable: false),
|
|
positionabsolutex = table.Column<double>(type: "double precision", nullable: true),
|
|
positionabsolutey = table.Column<double>(type: "double precision", nullable: true),
|
|
isdragging = table.Column<bool>(type: "boolean", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_tb_testcasenode", x => x.id);
|
|
table.ForeignKey(
|
|
name: "FK_tb_testcasenode_tb_casestepconfig_stepid",
|
|
column: x => x.stepid,
|
|
principalTable: "tb_casestepconfig",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.SetNull);
|
|
table.ForeignKey(
|
|
name: "FK_tb_testcasenode_tb_testcaseflow_testcaseid",
|
|
column: x => x.testcaseid,
|
|
principalTable: "tb_testcaseflow",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_testcaseedge_edgeid",
|
|
table: "tb_testcaseedge",
|
|
column: "edgeid");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_testcaseedge_sourcenodeid",
|
|
table: "tb_testcaseedge",
|
|
column: "sourcenodeid");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_testcaseedge_targetnodeid",
|
|
table: "tb_testcaseedge",
|
|
column: "targetnodeid");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_testcaseedge_testcaseid",
|
|
table: "tb_testcaseedge",
|
|
column: "testcaseid");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_testcaseflow_isenabled",
|
|
table: "tb_testcaseflow",
|
|
column: "isenabled");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_testcaseflow_name",
|
|
table: "tb_testcaseflow",
|
|
column: "name");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_testcaseflow_type",
|
|
table: "tb_testcaseflow",
|
|
column: "type");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_tb_testcasenode_stepid",
|
|
table: "tb_testcasenode",
|
|
column: "stepid");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_testcasenode_nodeid",
|
|
table: "tb_testcasenode",
|
|
column: "nodeid");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_testcasenode_sequencenumber",
|
|
table: "tb_testcasenode",
|
|
column: "sequencenumber");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_testcasenode_testcaseid",
|
|
table: "tb_testcasenode",
|
|
column: "testcaseid");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "tb_testcaseedge");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "tb_testcasenode");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "tb_testcaseflow");
|
|
}
|
|
}
|
|
}
|
|
|