mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-27 15:07:03 +01:00
"Fix" SQLite down migration
This commit is contained in:
+45
-3
@@ -28,9 +28,51 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
if (migrationBuilder == null)
|
||||
throw new ArgumentNullException(nameof(migrationBuilder));
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DumpOnHeartbeatRestart",
|
||||
table: "DreamDaemonSettings");
|
||||
migrationBuilder.RenameTable(
|
||||
name: "DreamDaemonSettings",
|
||||
newName: "DreamDaemonSettings_down");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DreamDaemonSettings",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
AllowWebClient = table.Column<bool>(nullable: false),
|
||||
SecurityLevel = table.Column<int>(nullable: false),
|
||||
Port = table.Column<ushort>(nullable: false),
|
||||
StartupTimeout = table.Column<uint>(nullable: false),
|
||||
HeartbeatSeconds = table.Column<uint>(nullable: false),
|
||||
AutoStart = table.Column<bool>(nullable: false),
|
||||
InstanceId = table.Column<long>(nullable: false),
|
||||
TopicRequestTimeout = table.Column<uint>(nullable: false),
|
||||
AdditionalParameters = table.Column<string>(maxLength: 10000, nullable: false),
|
||||
Visibility = table.Column<bool>(nullable: false),
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DreamDaemonSettings", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_DreamDaemonSettings_Instances_InstanceId",
|
||||
column: x => x.InstanceId,
|
||||
principalTable: "Instances",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.Sql(
|
||||
$"INSERT INTO DreamDaemonSettings SELECT Id,AllowWebClient,SecurityLevel,Port,AutoStart,HeartbeatSeconds,StartupTimeout,InstanceId,TopicRequestTimeout,AdditionalParameters,Visibility FROM DreamDaemonSettings_down");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "DreamDaemonSettings_down");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "DreamDaemonSettings",
|
||||
newName: "DreamDaemonSettings_down");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "DreamDaemonSettings_down",
|
||||
newName: "DreamDaemonSettings");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user