tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
20200511012117_SLAddHeartbeat.cs
Go to the documentation of this file.
1using System;
2
3using Microsoft.EntityFrameworkCore.Migrations;
4
6{
10 public partial class SLAddHeartbeat : Migration
11 {
13 protected override void Up(MigrationBuilder migrationBuilder)
14 {
15 ArgumentNullException.ThrowIfNull(migrationBuilder);
16
17 migrationBuilder.AddColumn<uint>(
18 name: "HeartbeatSeconds",
19 table: "DreamDaemonSettings",
20 nullable: false,
21 defaultValue: 0U);
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 PrimaryPort = table.Column<ushort>(nullable: false),
42 SecondaryPort = table.Column<ushort>(nullable: false),
43 StartupTimeout = table.Column<uint>(nullable: false),
44 AutoStart = table.Column<bool>(nullable: false),
45 SoftRestart = table.Column<bool>(nullable: false),
46 SoftShutdown = table.Column<bool>(nullable: false),
47 ProcessId = table.Column<int>(nullable: true),
48 AccessToken = table.Column<string>(nullable: true),
49 InstanceId = table.Column<long>(nullable: false),
50 },
51 constraints: table =>
52 {
53 table.PrimaryKey("PK_DreamDaemonSettings", x => x.Id);
54 table.ForeignKey(
55 name: "FK_DreamDaemonSettings_Instances_InstanceId",
56 column: x => x.InstanceId,
57 principalTable: "Instances",
58 principalColumn: "Id",
59 onDelete: ReferentialAction.Cascade);
60 });
61
62 migrationBuilder.Sql(
63 $"INSERT INTO DreamDaemonSettings SELECT Id,AllowWebClient,SecurityLevel,PrimaryPort,SecondaryPort,StartupTimeout,AutoStart,SoftRestart,SoftShutdown,ProcessId,AccessToken,InstanceId FROM DreamDaemonSettings_down");
64
65 migrationBuilder.DropTable(
66 name: "DreamDaemonSettings_down");
67 }
68 }
69}
override void Down(MigrationBuilder migrationBuilder)