13 protected override void Up(MigrationBuilder migrationBuilder)
15 ArgumentNullException.ThrowIfNull(migrationBuilder);
17 migrationBuilder.DropForeignKey(
18 name:
"FK_Instances_WatchdogReattachInformations_WatchdogReattachInformationId",
21 migrationBuilder.DropForeignKey(
22 name:
"FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
25 migrationBuilder.DropIndex(
26 name:
"IX_TestMerges_PrimaryRevisionInformationId",
29 migrationBuilder.DropIndex(
30 name:
"IX_Instances_WatchdogReattachInformationId",
33 migrationBuilder.DropIndex(
34 name:
"IX_CompileJobs_JobId",
35 table:
"CompileJobs");
37 migrationBuilder.DropColumn(
38 name:
"WatchdogReattachInformationId",
41 migrationBuilder.AddColumn<
long>(
43 table:
"WatchdogReattachInformations",
47 migrationBuilder.AlterColumn<
long>(
48 name:
"PrimaryRevisionInformationId",
51 oldClrType: typeof(
long),
54 migrationBuilder.AlterColumn<
string>(
58 oldClrType: typeof(
string),
61 migrationBuilder.AlterColumn<
long>(
65 oldClrType: typeof(
long),
68 migrationBuilder.AlterColumn<
string>(
72 oldClrType: typeof(
string),
75 migrationBuilder.AlterColumn<Guid>(
76 name:
"DirectoryName",
79 oldClrType: typeof(Guid),
82 migrationBuilder.CreateIndex(
83 name:
"IX_WatchdogReattachInformations_InstanceId",
84 table:
"WatchdogReattachInformations",
88 migrationBuilder.CreateIndex(
89 name:
"IX_TestMerges_PrimaryRevisionInformationId",
91 column:
"PrimaryRevisionInformationId",
94 migrationBuilder.CreateIndex(
95 name:
"IX_CompileJobs_JobId",
100 migrationBuilder.AddForeignKey(
101 name:
"FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
103 column:
"PrimaryRevisionInformationId",
104 principalTable:
"RevisionInformations",
105 principalColumn:
"Id",
106 onDelete: ReferentialAction.Restrict);
108 migrationBuilder.AddForeignKey(
109 name:
"FK_WatchdogReattachInformations_Instances_InstanceId",
110 table:
"WatchdogReattachInformations",
111 column:
"InstanceId",
112 principalTable:
"Instances",
113 principalColumn:
"Id",
114 onDelete: ReferentialAction.Cascade);
118 protected override void Down(MigrationBuilder migrationBuilder)
120 ArgumentNullException.ThrowIfNull(migrationBuilder);
122 migrationBuilder.DropForeignKey(
123 name:
"FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
124 table:
"TestMerges");
126 migrationBuilder.DropForeignKey(
127 name:
"FK_WatchdogReattachInformations_Instances_InstanceId",
128 table:
"WatchdogReattachInformations");
130 migrationBuilder.DropIndex(
131 name:
"IX_WatchdogReattachInformations_InstanceId",
132 table:
"WatchdogReattachInformations");
134 migrationBuilder.DropIndex(
135 name:
"IX_TestMerges_PrimaryRevisionInformationId",
136 table:
"TestMerges");
138 migrationBuilder.DropIndex(
139 name:
"IX_CompileJobs_JobId",
140 table:
"CompileJobs");
142 migrationBuilder.DropColumn(
144 table:
"WatchdogReattachInformations");
146 migrationBuilder.AlterColumn<
long>(
147 name:
"PrimaryRevisionInformationId",
150 oldClrType: typeof(
long));
152 migrationBuilder.AddColumn<
long>(
153 name:
"WatchdogReattachInformationId",
157 migrationBuilder.AlterColumn<
string>(
159 table:
"CompileJobs",
161 oldClrType: typeof(
string));
163 migrationBuilder.AlterColumn<
long>(
165 table:
"CompileJobs",
167 oldClrType: typeof(
long));
169 migrationBuilder.AlterColumn<
string>(
171 table:
"CompileJobs",
173 oldClrType: typeof(
string));
175 migrationBuilder.AlterColumn<Guid>(
176 name:
"DirectoryName",
177 table:
"CompileJobs",
179 oldClrType: typeof(Guid));
181 migrationBuilder.CreateIndex(
182 name:
"IX_TestMerges_PrimaryRevisionInformationId",
184 column:
"PrimaryRevisionInformationId",
186 filter:
"[PrimaryRevisionInformationId] IS NOT NULL");
188 migrationBuilder.CreateIndex(
189 name:
"IX_Instances_WatchdogReattachInformationId",
191 column:
"WatchdogReattachInformationId");
193 migrationBuilder.CreateIndex(
194 name:
"IX_CompileJobs_JobId",
195 table:
"CompileJobs",
198 migrationBuilder.AddForeignKey(
199 name:
"FK_Instances_WatchdogReattachInformations_WatchdogReattachInformationId",
201 column:
"WatchdogReattachInformationId",
202 principalTable:
"WatchdogReattachInformations",
203 principalColumn:
"Id",
204 onDelete: ReferentialAction.Restrict);
206 migrationBuilder.AddForeignKey(
207 name:
"FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
209 column:
"PrimaryRevisionInformationId",
210 principalTable:
"RevisionInformations",
211 principalColumn:
"Id",
212 onDelete: ReferentialAction.SetNull);