13 protected override void Up(MigrationBuilder migrationBuilder)
15 ArgumentNullException.ThrowIfNull(migrationBuilder);
17 migrationBuilder.AddColumn<
bool>(
18 name:
"CreateGitHubDeployments",
19 table:
"RepositorySettings",
23 migrationBuilder.AddColumn<
int>(
24 name:
"GitHubDeploymentId",
28 migrationBuilder.AddColumn<
long>(
35 protected override void Down(MigrationBuilder migrationBuilder)
37 ArgumentNullException.ThrowIfNull(migrationBuilder);
39 migrationBuilder.RenameTable(
40 name:
"RepositorySettings",
41 newName:
"RepositorySettings_down");
43 migrationBuilder.CreateTable(
44 name:
"RepositorySettings",
47 Id = table.Column<
long>(nullable:
false)
48 .Annotation(
"Sqlite:Autoincrement",
true),
49 CommitterName = table.Column<
string>(maxLength: 10000, nullable:
false),
50 CommitterEmail = table.Column<
string>(maxLength: 10000, nullable:
false),
51 AccessUser = table.Column<
string>(maxLength: 10000, nullable:
true),
52 AccessToken = table.Column<
string>(maxLength: 10000, nullable:
true),
53 PushTestMergeCommits = table.Column<
bool>(nullable:
false),
54 ShowTestMergeCommitters = table.Column<
bool>(nullable:
false),
55 AutoUpdatesKeepTestMerges = table.Column<
bool>(nullable:
false),
56 AutoUpdatesSynchronize = table.Column<
bool>(nullable:
false),
57 PostTestMergeComment = table.Column<
bool>(nullable:
false),
58 InstanceId = table.Column<
long>(nullable:
false),
62 table.PrimaryKey(
"PK_RepositorySettings", x => x.Id);
64 name:
"FK_RepositorySettings_Instances_InstanceId",
65 column: x => x.InstanceId,
66 principalTable:
"Instances",
67 principalColumn:
"Id",
68 onDelete: ReferentialAction.Cascade);
72 $
"INSERT INTO RepositorySettings SELECT Id,CommitterName,CommitterEmail,AccessUser,AccessToken,PushTestMergeCommits,ShowTestMergeCommitters,AutoUpdatesKeepTestMerges,AutoUpdatesSynchronize,PostTestMergeComment,InstanceId FROM RepositorySettings_down");
74 migrationBuilder.DropTable(
75 name:
"RepositorySettings_down");
77 migrationBuilder.RenameTable(
79 newName:
"CompileJobs_down");
81 migrationBuilder.CreateTable(
85 Id = table.Column<
long>(nullable:
false)
86 .Annotation(
"Sqlite:Autoincrement",
true),
87 DmeName = table.Column<
string>(nullable:
false),
88 Output = table.Column<
string>(nullable:
false),
89 DirectoryName = table.Column<Guid>(nullable:
false),
90 MinimumSecurityLevel = table.Column<
int>(nullable:
true),
91 JobId = table.Column<
long>(nullable:
false),
92 RevisionInformationId = table.Column<
long>(nullable:
false),
93 ByondVersion = table.Column<
string>(nullable:
false),
94 DMApiMajorVersion = table.Column<
int>(nullable:
true),
95 DMApiMinorVersion = table.Column<
int>(nullable:
true),
96 DMApiPatchVersion = table.Column<
int>(nullable:
true),
100 table.PrimaryKey(
"PK_CompileJobs", x => x.Id);
102 name:
"FK_CompileJobs_Jobs_JobId",
103 column: x => x.JobId,
104 principalTable:
"Jobs",
105 principalColumn:
"Id",
106 onDelete: ReferentialAction.Cascade);
108 name:
"FK_CompileJobs_RevisionInformations_RevisionInformationId",
109 column: x => x.RevisionInformationId,
110 principalTable:
"RevisionInformations",
111 principalColumn:
"Id");
114 migrationBuilder.Sql(
115 $
"INSERT INTO CompileJobs SELECT Id,DmeName,Output,DirectoryName,MinimumSecurityLevel,JobId,RevisionInformationId,ByondVersion,DMApiMajorVersion,DMApiMinorVersion,DMApiPatchVersion FROM CompileJobs_down");
117 migrationBuilder.DropTable(
118 name:
"CompileJobs_down");