tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
20200427180159_MYFixCascadingDelete.cs
Go to the documentation of this file.
1using System;
2
3using Microsoft.EntityFrameworkCore.Migrations;
4
6{
10 public partial class MYFixCascadingDelete : Migration
11 {
13 protected override void Up(MigrationBuilder migrationBuilder)
14 {
15 ArgumentNullException.ThrowIfNull(migrationBuilder);
16
17 migrationBuilder.DropForeignKey(
18 name: "FK_CompileJobs_Jobs_JobId",
19 table: "CompileJobs");
20
21 migrationBuilder.DropForeignKey(
22 name: "FK_CompileJobs_RevisionInformations_RevisionInformationId",
23 table: "CompileJobs");
24
25 migrationBuilder.DropForeignKey(
26 name: "FK_RevInfoTestMerges_TestMerges_TestMergeId",
27 table: "RevInfoTestMerges");
28
29 migrationBuilder.DropForeignKey(
30 name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
31 table: "TestMerges");
32
33 migrationBuilder.AddForeignKey(
34 name: "FK_CompileJobs_Jobs_JobId",
35 table: "CompileJobs",
36 column: "JobId",
37 principalTable: "Jobs",
38 principalColumn: "Id",
39 onDelete: ReferentialAction.Cascade);
40
41 migrationBuilder.AddForeignKey(
42 name: "FK_CompileJobs_RevisionInformations_RevisionInformationId",
43 table: "CompileJobs",
44 column: "RevisionInformationId",
45 principalTable: "RevisionInformations",
46 principalColumn: "Id");
47
48 migrationBuilder.AddForeignKey(
49 name: "FK_RevInfoTestMerges_TestMerges_TestMergeId",
50 table: "RevInfoTestMerges",
51 column: "TestMergeId",
52 principalTable: "TestMerges",
53 principalColumn: "Id");
54
55 migrationBuilder.AddForeignKey(
56 name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
57 table: "TestMerges",
58 column: "PrimaryRevisionInformationId",
59 principalTable: "RevisionInformations",
60 principalColumn: "Id",
61 onDelete: ReferentialAction.Cascade);
62 }
63
65 protected override void Down(MigrationBuilder migrationBuilder)
66 {
67 ArgumentNullException.ThrowIfNull(migrationBuilder);
68
69 migrationBuilder.DropForeignKey(
70 name: "FK_CompileJobs_Jobs_JobId",
71 table: "CompileJobs");
72
73 migrationBuilder.DropForeignKey(
74 name: "FK_CompileJobs_RevisionInformations_RevisionInformationId",
75 table: "CompileJobs");
76
77 migrationBuilder.DropForeignKey(
78 name: "FK_RevInfoTestMerges_TestMerges_TestMergeId",
79 table: "RevInfoTestMerges");
80
81 migrationBuilder.DropForeignKey(
82 name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
83 table: "TestMerges");
84
85 migrationBuilder.AddForeignKey(
86 name: "FK_CompileJobs_Jobs_JobId",
87 table: "CompileJobs",
88 column: "JobId",
89 principalTable: "Jobs",
90 principalColumn: "Id",
91 onDelete: ReferentialAction.Restrict);
92
93 migrationBuilder.AddForeignKey(
94 name: "FK_CompileJobs_RevisionInformations_RevisionInformationId",
95 table: "CompileJobs",
96 column: "RevisionInformationId",
97 principalTable: "RevisionInformations",
98 principalColumn: "Id",
99 onDelete: ReferentialAction.Cascade);
100
101 migrationBuilder.AddForeignKey(
102 name: "FK_RevInfoTestMerges_TestMerges_TestMergeId",
103 table: "RevInfoTestMerges",
104 column: "TestMergeId",
105 principalTable: "TestMerges",
106 principalColumn: "Id",
107 onDelete: ReferentialAction.Cascade);
108
109 migrationBuilder.AddForeignKey(
110 name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
111 table: "TestMerges",
112 column: "PrimaryRevisionInformationId",
113 principalTable: "RevisionInformations",
114 principalColumn: "Id",
115 onDelete: ReferentialAction.Restrict);
116 }
117 }
118}