tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
20220811163432_SLAddDumpOnHeartbeatRestart.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.AddColumn<bool>(
18 name: "DumpOnHeartbeatRestart",
19 table: "DreamDaemonSettings",
20 nullable: false,
21 defaultValue: false);
22 }
23
25 protected override void Down(MigrationBuilder migrationBuilder)
26 {
27 ArgumentNullException.ThrowIfNull(migrationBuilder);
28
29 migrationBuilder.RenameTable(
30 name: "DreamDaemonSettings",
31 newName: "DreamDaemonSettings_down");
32
33 migrationBuilder.CreateTable(
34 name: "DreamDaemonSettings",
35 columns: table => new
36 {
37 Id = table.Column<long>(nullable: false)
38 .Annotation("Sqlite:Autoincrement", true),
39 AllowWebClient = table.Column<bool>(nullable: false),
40 SecurityLevel = table.Column<int>(nullable: false),
41 Port = table.Column<ushort>(nullable: false),
42 StartupTimeout = table.Column<uint>(nullable: false),
43 HeartbeatSeconds = table.Column<uint>(nullable: false),
44 AutoStart = table.Column<bool>(nullable: false),
45 InstanceId = table.Column<long>(nullable: false),
46 TopicRequestTimeout = table.Column<uint>(nullable: false),
47 AdditionalParameters = table.Column<string>(maxLength: 10000, nullable: false),
48 Visibility = table.Column<bool>(nullable: false),
49 },
50 constraints: table =>
51 {
52 table.PrimaryKey("PK_DreamDaemonSettings", x => x.Id);
53 table.ForeignKey(
54 name: "FK_DreamDaemonSettings_Instances_InstanceId",
55 column: x => x.InstanceId,
56 principalTable: "Instances",
57 principalColumn: "Id",
58 onDelete: ReferentialAction.Cascade);
59 });
60
61 migrationBuilder.Sql(
62 $"INSERT INTO DreamDaemonSettings SELECT Id,AllowWebClient,SecurityLevel,Port,AutoStart,HeartbeatSeconds,StartupTimeout,InstanceId,TopicRequestTimeout,AdditionalParameters,Visibility FROM DreamDaemonSettings_down");
63
64 migrationBuilder.DropTable(
65 name: "DreamDaemonSettings_down");
66
67 migrationBuilder.RenameTable(
68 name: "DreamDaemonSettings",
69 newName: "DreamDaemonSettings_down");
70
71 migrationBuilder.RenameTable(
72 name: "DreamDaemonSettings_down",
73 newName: "DreamDaemonSettings");
74 }
75 }
76}
Adds the DreamMakerSettings DumpOnHeartbeatRestart column for SQLite.