13 protected override void Up(MigrationBuilder migrationBuilder)
15 ArgumentNullException.ThrowIfNull(migrationBuilder);
17 migrationBuilder.DropForeignKey(
18 name:
"FK_Instances_WatchdogReattachInformations_WatchdogReattachInfor~",
21 migrationBuilder.DropForeignKey(
22 name:
"FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
25 migrationBuilder.DropForeignKey(
26 name:
"FK_CompileJobs_Jobs_JobId",
27 table:
"CompileJobs");
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_CompileJobs_JobId",
94 migrationBuilder.AddForeignKey(
95 name:
"FK_CompileJobs_Jobs_JobId",
98 principalTable:
"Jobs",
99 principalColumn:
"Id",
100 onDelete: ReferentialAction.Restrict);
102 migrationBuilder.AddForeignKey(
103 name:
"FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
105 column:
"PrimaryRevisionInformationId",
106 principalTable:
"RevisionInformations",
107 principalColumn:
"Id",
108 onDelete: ReferentialAction.Restrict);
110 migrationBuilder.AddForeignKey(
111 name:
"FK_WatchdogReattachInformations_Instances_InstanceId",
112 table:
"WatchdogReattachInformations",
113 column:
"InstanceId",
114 principalTable:
"Instances",
115 principalColumn:
"Id",
116 onDelete: ReferentialAction.Cascade);
120 protected override void Down(MigrationBuilder migrationBuilder)
122 ArgumentNullException.ThrowIfNull(migrationBuilder);
124 migrationBuilder.DropForeignKey(
125 name:
"FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
126 table:
"TestMerges");
128 migrationBuilder.DropForeignKey(
129 name:
"FK_WatchdogReattachInformations_Instances_InstanceId",
130 table:
"WatchdogReattachInformations");
132 migrationBuilder.DropForeignKey(
133 name:
"FK_CompileJobs_Jobs_JobId",
134 table:
"CompileJobs");
136 migrationBuilder.DropIndex(
137 name:
"IX_WatchdogReattachInformations_InstanceId",
138 table:
"WatchdogReattachInformations");
140 migrationBuilder.DropIndex(
141 name:
"IX_CompileJobs_JobId",
142 table:
"CompileJobs");
144 migrationBuilder.DropColumn(
146 table:
"WatchdogReattachInformations");
148 migrationBuilder.AlterColumn<
long>(
149 name:
"PrimaryRevisionInformationId",
152 oldClrType: typeof(
long));
154 migrationBuilder.AddColumn<
long>(
155 name:
"WatchdogReattachInformationId",
159 migrationBuilder.AlterColumn<
string>(
161 table:
"CompileJobs",
163 oldClrType: typeof(
string));
165 migrationBuilder.AlterColumn<
long>(
167 table:
"CompileJobs",
169 oldClrType: typeof(
long));
171 migrationBuilder.AlterColumn<
string>(
173 table:
"CompileJobs",
175 oldClrType: typeof(
string));
177 migrationBuilder.AlterColumn<Guid>(
178 name:
"DirectoryName",
179 table:
"CompileJobs",
181 oldClrType: typeof(Guid));
183 migrationBuilder.CreateIndex(
184 name:
"IX_Instances_WatchdogReattachInformationId",
186 column:
"WatchdogReattachInformationId");
188 migrationBuilder.CreateIndex(
189 name:
"IX_CompileJobs_JobId",
190 table:
"CompileJobs",
193 migrationBuilder.AddForeignKey(
194 name:
"FK_CompileJobs_Jobs_JobId",
195 table:
"CompileJobs",
197 principalTable:
"Jobs",
198 principalColumn:
"Id",
199 onDelete: ReferentialAction.Restrict);
201 migrationBuilder.AddForeignKey(
202 name:
"FK_Instances_WatchdogReattachInformations_WatchdogReattachInfor~",
204 column:
"WatchdogReattachInformationId",
205 principalTable:
"WatchdogReattachInformations",
206 principalColumn:
"Id",
207 onDelete: ReferentialAction.Restrict);
209 migrationBuilder.AddForeignKey(
210 name:
"FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
212 column:
"PrimaryRevisionInformationId",
213 principalTable:
"RevisionInformations",
214 principalColumn:
"Id",
215 onDelete: ReferentialAction.SetNull);