13 protected override void Up(MigrationBuilder migrationBuilder)
15 ArgumentNullException.ThrowIfNull(migrationBuilder);
17 migrationBuilder.DropForeignKey(
18 name:
"FK_RevisionInformations_Instances_InstanceId",
19 table:
"RevisionInformations");
21 migrationBuilder.DropIndex(
22 name:
"IX_RevisionInformations_CommitSha",
23 table:
"RevisionInformations");
25 migrationBuilder.DropIndex(
26 name:
"IX_RevisionInformations_InstanceId",
27 table:
"RevisionInformations");
29 migrationBuilder.CreateIndex(
30 name:
"IX_RevisionInformations_InstanceId_CommitSha",
31 table:
"RevisionInformations",
32 columns:
new[] {
"InstanceId",
"CommitSha" },
35 migrationBuilder.AddForeignKey(
36 name:
"FK_RevisionInformations_Instances_InstanceId",
37 table:
"RevisionInformations",
39 principalTable:
"Instances",
40 principalColumn:
"Id",
41 onDelete: ReferentialAction.Cascade);
45 protected override void Down(MigrationBuilder migrationBuilder)
47 ArgumentNullException.ThrowIfNull(migrationBuilder);
49 migrationBuilder.DropForeignKey(
50 name:
"FK_RevisionInformations_Instances_InstanceId",
51 table:
"RevisionInformations");
53 migrationBuilder.DropIndex(
54 name:
"IX_RevisionInformations_InstanceId_CommitSha",
55 table:
"RevisionInformations");
57 migrationBuilder.CreateIndex(
58 name:
"IX_RevisionInformations_CommitSha",
59 table:
"RevisionInformations",
63 migrationBuilder.CreateIndex(
64 name:
"IX_RevisionInformations_InstanceId",
65 table:
"RevisionInformations",
66 column:
"InstanceId");
68 migrationBuilder.AddForeignKey(
69 name:
"FK_RevisionInformations_Instances_InstanceId",
70 table:
"RevisionInformations",
72 principalTable:
"Instances",
73 principalColumn:
"Id",
74 onDelete: ReferentialAction.Cascade);