tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
20201209194554_SLGenericTestMergingUpdate.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.RenameColumn(
18 name: "PullRequestRevision",
19 table: "TestMerges",
20 newName: "TargetCommitSha");
21
22 migrationBuilder.AddColumn<string>(
23 name: "RepositoryOrigin",
24 table: "CompileJobs",
25 nullable: true);
26 }
27
29 protected override void Down(MigrationBuilder migrationBuilder)
30 {
31 ArgumentNullException.ThrowIfNull(migrationBuilder);
32
33 migrationBuilder.RenameColumn(
34 name: "TargetCommitSha",
35 table: "TestMerges",
36 newName: "PullRequestRevision");
37
38 migrationBuilder.RenameTable(
39 name: "CompileJobs",
40 newName: "CompileJobs_down");
41
42 migrationBuilder.CreateTable(
43 name: "CompileJobs",
44 columns: table => new
45 {
46 Id = table.Column<long>(nullable: false)
47 .Annotation("Sqlite:Autoincrement", true),
48 DmeName = table.Column<string>(nullable: false),
49 Output = table.Column<string>(nullable: false),
50 DirectoryName = table.Column<Guid>(nullable: false),
51 MinimumSecurityLevel = table.Column<int>(nullable: true),
52 JobId = table.Column<long>(nullable: false),
53 RevisionInformationId = table.Column<long>(nullable: false),
54 ByondVersion = table.Column<string>(nullable: false),
55 DMApiMajorVersion = table.Column<int>(nullable: true),
56 DMApiMinorVersion = table.Column<int>(nullable: true),
57 DMApiPatchVersion = table.Column<int>(nullable: true),
58 GitHubDeploymentId = table.Column<long>(nullable: true),
59 GitHubRepoId = table.Column<long>(nullable: true),
60 },
61 constraints: table =>
62 {
63 table.PrimaryKey("PK_CompileJobs", x => x.Id);
64 table.ForeignKey(
65 name: "FK_CompileJobs_Jobs_JobId",
66 column: x => x.JobId,
67 principalTable: "Jobs",
68 principalColumn: "Id",
69 onDelete: ReferentialAction.Cascade);
70 table.ForeignKey(
71 name: "FK_CompileJobs_RevisionInformations_RevisionInformationId",
72 column: x => x.RevisionInformationId,
73 principalTable: "RevisionInformations",
74 principalColumn: "Id");
75 });
76
77 migrationBuilder.Sql(
78 $"INSERT INTO CompileJobs SELECT Id,DmeName,Output,DirectoryName,MinimumSecurityLevel,JobId,RevisionInformationId,ByondVersion,DMApiMajorVersion,DMApiMinorVersion,DMApiPatchVersion,GitHubDeploymentId,GitHubRepoId FROM CompileJobs_down");
79
80 migrationBuilder.DropTable(
81 name: "CompileJobs_down");
82 }
83 }
84}
Renames the PullRequestRevision and adds the RepositoryOrigin columns for SQLite.