15 protected override void Up(MigrationBuilder migrationBuilder)
17 ArgumentNullException.ThrowIfNull(migrationBuilder);
19 migrationBuilder.AddColumn<
bool>(
20 name:
"RequireDMApiValidation",
21 table:
"DreamMakerSettings",
25 migrationBuilder.RenameTable(
27 newName:
"CompileJobs_up");
29 migrationBuilder.CreateTable(
33 Id = table.Column<
long>(nullable:
false)
34 .Annotation(
"Sqlite:Autoincrement",
true),
35 DmeName = table.Column<
string>(nullable:
false),
36 Output = table.Column<
string>(nullable:
false),
37 DirectoryName = table.Column<Guid>(nullable:
false),
38 MinimumSecurityLevel = table.Column<
int>(nullable:
true),
39 JobId = table.Column<
long>(nullable:
false),
40 RevisionInformationId = table.Column<
long>(nullable:
false),
41 ByondVersion = table.Column<
string>(nullable:
false),
42 DMApiMajorVersion = table.Column<
int>(nullable:
true),
43 DMApiMinorVersion = table.Column<
int>(nullable:
true),
44 DMApiPatchVersion = table.Column<
int>(nullable:
true),
48 table.PrimaryKey(
"PK_CompileJobs", x => x.Id);
50 name:
"FK_CompileJobs_Jobs_JobId",
52 principalTable:
"Jobs",
53 principalColumn:
"Id",
54 onDelete: ReferentialAction.Cascade);
56 name:
"FK_CompileJobs_RevisionInformations_RevisionInformationId",
57 column: x => x.RevisionInformationId,
58 principalTable:
"RevisionInformations",
59 principalColumn:
"Id");
63 $
"INSERT INTO CompileJobs SELECT * FROM CompileJobs_up");
65 migrationBuilder.DropTable(
66 name:
"CompileJobs_up");
69 migrationBuilder.RenameTable(
71 newName:
"CompileJobs_up");
73 migrationBuilder.RenameTable(
74 name:
"CompileJobs_up",
75 newName:
"CompileJobs");
79 protected override void Down(MigrationBuilder migrationBuilder)
81 ArgumentNullException.ThrowIfNull(migrationBuilder);
83 migrationBuilder.RenameTable(
85 newName:
"CompileJobs_down");
87 migrationBuilder.CreateTable(
91 Id = table.Column<
long>(nullable:
false)
92 .Annotation(
"Sqlite:Autoincrement",
true),
93 DmeName = table.Column<
string>(nullable:
false),
94 Output = table.Column<
string>(nullable:
false),
95 DirectoryName = table.Column<Guid>(nullable:
false),
96 MinimumSecurityLevel = table.Column<
int>(nullable:
false, defaultValue:
DreamDaemonSecurity.Ultrasafe),
97 JobId = table.Column<
long>(nullable:
false),
98 RevisionInformationId = table.Column<
long>(nullable:
false),
99 ByondVersion = table.Column<
string>(nullable:
false),
100 DMApiMajorVersion = table.Column<
int>(nullable:
true),
101 DMApiMinorVersion = table.Column<
int>(nullable:
true),
102 DMApiPatchVersion = table.Column<
int>(nullable:
true),
104 constraints: table =>
106 table.PrimaryKey(
"PK_CompileJobs", x => x.Id);
108 name:
"FK_CompileJobs_Jobs_JobId",
109 column: x => x.JobId,
110 principalTable:
"Jobs",
111 principalColumn:
"Id",
112 onDelete: ReferentialAction.Cascade);
114 name:
"FK_CompileJobs_RevisionInformations_RevisionInformationId",
115 column: x => x.RevisionInformationId,
116 principalTable:
"RevisionInformations",
117 principalColumn:
"Id");
120 migrationBuilder.Sql(
121 $
"INSERT INTO CompileJobs SELECT * FROM CompileJobs_down");
123 migrationBuilder.DropTable(
124 name:
"CompileJobs_down");
126 migrationBuilder.RenameTable(
128 newName:
"CompileJobs_down");
130 migrationBuilder.RenameTable(
131 name:
"CompileJobs_down",
132 newName:
"CompileJobs");
134 migrationBuilder.RenameTable(
135 name:
"DreamMakerSettings",
136 newName:
"DreamMakerSettings_down");
138 migrationBuilder.CreateTable(
139 name:
"DreamMakerSettings",
140 columns: table =>
new
142 Id = table.Column<
long>(nullable:
false)
143 .Annotation(
"Sqlite:Autoincrement",
true),
144 ProjectName = table.Column<
string>(maxLength: 10000, nullable:
true),
145 ApiValidationPort = table.Column<ushort>(nullable:
false),
146 ApiValidationSecurityLevel = table.Column<
int>(nullable:
false),
147 InstanceId = table.Column<
long>(nullable:
false),
149 constraints: table =>
151 table.PrimaryKey(
"PK_DreamMakerSettings", x => x.Id);
153 name:
"FK_DreamMakerSettings_Instances_InstanceId",
154 column: x => x.InstanceId,
155 principalTable:
"Instances",
156 principalColumn:
"Id",
157 onDelete: ReferentialAction.Cascade);
160 migrationBuilder.Sql(
161 $
"INSERT INTO DreamMakerSettings SELECT Id,ProjectName,ApiValidationPort,ApiValidationSecurityLevel,InstanceId FROM DreamMakerSettings_down");
163 migrationBuilder.DropTable(
164 name:
"DreamMakerSettings_down");