tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
20240907172251_PGAddDMApiValidationMode.cs
Go to the documentation of this file.
1using System;
2
3using Microsoft.EntityFrameworkCore.Migrations;
4
6{
8 public partial class PGAddDMApiValidationMode : Migration
9 {
11 protected override void Up(MigrationBuilder migrationBuilder)
12 {
13 ArgumentNullException.ThrowIfNull(migrationBuilder);
14
15 migrationBuilder.AddColumn<int>(
16 name: "DMApiValidationMode",
17 table: "DreamMakerSettings",
18 type: "integer",
19 nullable: false,
20 defaultValue: 0);
21
22 migrationBuilder.Sql("UPDATE \"DreamMakerSettings\" SET \"DMApiValidationMode\" = \"RequireDMApiValidation\"::int");
23
24 migrationBuilder.DropColumn(
25 name: "RequireDMApiValidation",
26 table: "DreamMakerSettings");
27 }
28
30 protected override void Down(MigrationBuilder migrationBuilder)
31 {
32 ArgumentNullException.ThrowIfNull(migrationBuilder);
33
34 migrationBuilder.AddColumn<bool>(
35 name: "RequireDMApiValidation",
36 table: "DreamMakerSettings",
37 type: "boolean",
38 nullable: false,
39 defaultValue: false);
40
41 migrationBuilder.Sql("UPDATE \"DreamMakerSettings\" SET \"RequireDMApiValidation\" = true WHERE \"DMApiValidationMode\" != 0");
42 migrationBuilder.Sql("UPDATE \"DreamMakerSettings\" SET \"RequireDMApiValidation\" = false WHERE \"DMApiValidationMode\" = 0");
43
44 migrationBuilder.DropColumn(
45 name: "DMApiValidationMode",
46 table: "DreamMakerSettings");
47 }
48 }
49}