tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
20200616180742_SLTopicTimeout.cs
Go to the documentation of this file.
1using System;
2
3using Microsoft.EntityFrameworkCore.Migrations;
4
6{
10 public partial class SLTopicTimeout : Migration
11 {
13 protected override void Up(MigrationBuilder migrationBuilder)
14 {
15 ArgumentNullException.ThrowIfNull(migrationBuilder);
16 migrationBuilder.AddColumn<uint>(
17 name: "TopicRequestTimeout",
18 table: "DreamDaemonSettings",
19 nullable: false,
20 defaultValue: 0u);
21 }
22
24 protected override void Down(MigrationBuilder migrationBuilder)
25 {
26 ArgumentNullException.ThrowIfNull(migrationBuilder);
27
28 migrationBuilder.RenameTable(
29 name: "DreamDaemonSettings",
30 newName: "DreamDaemonSettings_down");
31
32 migrationBuilder.CreateTable(
33 name: "DreamDaemonSettings",
34 columns: table => new
35 {
36 Id = table.Column<long>(nullable: false)
37 .Annotation("Sqlite:Autoincrement", true),
38 AllowWebClient = table.Column<bool>(nullable: false),
39 SecurityLevel = table.Column<int>(nullable: false),
40 PrimaryPort = table.Column<ushort>(nullable: false),
41 SecondaryPort = table.Column<ushort>(nullable: false),
42 StartupTimeout = table.Column<uint>(nullable: false),
43 AutoStart = table.Column<bool>(nullable: false),
44 InstanceId = table.Column<long>(nullable: false),
45 HeartbeatSeconds = table.Column<uint>(nullable: false),
46 },
47 constraints: table =>
48 {
49 table.PrimaryKey("PK_DreamDaemonSettings", x => x.Id);
50 table.ForeignKey(
51 name: "FK_DreamDaemonSettings_Instances_InstanceId",
52 column: x => x.InstanceId,
53 principalTable: "Instances",
54 principalColumn: "Id",
55 onDelete: ReferentialAction.Cascade);
56 });
57
58 migrationBuilder.Sql(
59 $"INSERT INTO DreamDaemonSettings SELECT Id,AllowWebClient,SecurityLevel,PrimaryPort,SecondaryPort,StartupTimeout,AutoStart,InstanceId,HeartbeatSeconds FROM DreamDaemonSettings_down");
60
61 migrationBuilder.DropTable(
62 name: "DreamDaemonSettings_down");
63 }
64 }
65}
override void Down(MigrationBuilder migrationBuilder)