using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace X1.Infrastructure.Migrations { /// public partial class AddTestCaseFlowTables : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "tb_testcaseflow", columns: table => new { id = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), name = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), description = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true), type = table.Column(type: "integer", nullable: false), isenabled = table.Column(type: "boolean", nullable: false), viewport_x = table.Column(type: "double precision", nullable: false), viewport_y = table.Column(type: "double precision", nullable: false), viewport_zoom = table.Column(type: "double precision", nullable: false), createdat = table.Column(type: "timestamp with time zone", nullable: false), updatedat = table.Column(type: "timestamp with time zone", nullable: false), createdby = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), updatedby = table.Column(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(type: "character varying(450)", maxLength: 450, nullable: false), testcaseid = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), edgeid = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), sourcenodeid = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), targetnodeid = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), edgetype = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), condition = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), isanimated = table.Column(type: "boolean", nullable: false), style = table.Column(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(type: "character varying(450)", maxLength: 450, nullable: false), testcaseid = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), nodeid = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), sequencenumber = table.Column(type: "integer", nullable: false), stepid = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), positionx = table.Column(type: "double precision", nullable: false), positiony = table.Column(type: "double precision", nullable: false), width = table.Column(type: "double precision", nullable: false), height = table.Column(type: "double precision", nullable: false), isselected = table.Column(type: "boolean", nullable: false), positionabsolutex = table.Column(type: "double precision", nullable: true), positionabsolutey = table.Column(type: "double precision", nullable: true), isdragging = table.Column(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"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "tb_testcaseedge"); migrationBuilder.DropTable( name: "tb_testcasenode"); migrationBuilder.DropTable( name: "tb_testcaseflow"); } } }