tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
20180926033145_MSReattachCompileJobRequired.cs
Go to the documentation of this file.
1using System;
2
3using Microsoft.EntityFrameworkCore.Migrations;
4
6{
11 {
13 protected override void Up(MigrationBuilder migrationBuilder)
14 {
15 ArgumentNullException.ThrowIfNull(migrationBuilder);
16
17 migrationBuilder.DropForeignKey(
18 name: "FK_ReattachInformations_CompileJobs_CompileJobId",
19 table: "ReattachInformations");
20
21 migrationBuilder.AlterColumn<long>(
22 name: "CompileJobId",
23 table: "ReattachInformations",
24 nullable: false,
25 oldClrType: typeof(long),
26 oldNullable: true);
27
28 migrationBuilder.AddForeignKey(
29 name: "FK_ReattachInformations_CompileJobs_CompileJobId",
30 table: "ReattachInformations",
31 column: "CompileJobId",
32 principalTable: "CompileJobs",
33 principalColumn: "Id",
34 onDelete: ReferentialAction.Cascade);
35 }
36
38 protected override void Down(MigrationBuilder migrationBuilder)
39 {
40 ArgumentNullException.ThrowIfNull(migrationBuilder);
41
42 migrationBuilder.DropForeignKey(
43 name: "FK_ReattachInformations_CompileJobs_CompileJobId",
44 table: "ReattachInformations");
45
46 migrationBuilder.AlterColumn<long>(
47 name: "CompileJobId",
48 table: "ReattachInformations",
49 nullable: true,
50 oldClrType: typeof(long));
51
52 migrationBuilder.AddForeignKey(
53 name: "FK_ReattachInformations_CompileJobs_CompileJobId",
54 table: "ReattachInformations",
55 column: "CompileJobId",
56 principalTable: "CompileJobs",
57 principalColumn: "Id",
58 onDelete: ReferentialAction.Restrict);
59 }
60 }
61}
Marks the Models.CompileJobs of Models.ReattachInformations as non-nullable for MSSQL.