tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
20240907172244_MYAddDMApiValidationMode.cs
Go to the documentation of this file.
1using System;
2
3using Microsoft.EntityFrameworkCore.Migrations;
4
6{
8 public partial class MYAddDMApiValidationMode : 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: "int",
19 nullable: false,
20 defaultValue: 0);
21
22 migrationBuilder.Sql("UPDATE DreamMakerSettings SET DMApiValidationMode = RequireDMApiValidation");
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: "tinyint(1)",
38 nullable: false,
39 defaultValue: false);
40
41 migrationBuilder.Sql("UPDATE DreamMakerSettings SET RequireDMApiValidation = 1 WHERE DMApiValidationMode != 0");
42 migrationBuilder.Sql("UPDATE DreamMakerSettings SET RequireDMApiValidation = 0 WHERE DMApiValidationMode = 0");
43
44 migrationBuilder.DropColumn(
45 name: "DMApiValidationMode",
46 table: "DreamMakerSettings");
47 }
48 }
49}