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