Files
Deluxe-2023-Server-Code/Migrations/20260420200518_heartbeatData.cs
T
Exception 1f113298e0 Movement
2026-05-09 14:31:53 -04:00

92 lines
4.5 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DeluxeNET.Migrations
{
/// <inheritdoc />
public partial class heartbeatData : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "RoomInstance",
columns: table => new
{
RoomInstanceId = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
RoomId = table.Column<long>(type: "bigint", nullable: false),
SubRoomId = table.Column<long>(type: "bigint", nullable: false),
Location = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
RoomInstanceType = table.Column<int>(type: "int", nullable: false),
PhotonRegionId = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
PhotonRegion = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
PhotonRoomId = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
MaxCapacity = table.Column<int>(type: "int", nullable: false),
IsFull = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsPrivate = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsInProgress = table.Column<bool>(type: "tinyint(1)", nullable: false),
MatchmakingPolicy = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_RoomInstance", x => x.RoomInstanceId);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Heartbeats",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
PlayerId = table.Column<long>(type: "bigint", nullable: false),
StatusVisibility = table.Column<int>(type: "int", nullable: false),
Platform = table.Column<int>(type: "int", nullable: false),
DeviceClass = table.Column<int>(type: "int", nullable: false),
RoomInstanceId = table.Column<long>(type: "bigint", nullable: true),
VrMovementMode = table.Column<int>(type: "int", nullable: false),
LastOnline = table.Column<DateTime>(type: "datetime(6)", nullable: false),
IsOnline = table.Column<bool>(type: "tinyint(1)", nullable: false),
AppVersion = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_Heartbeats", x => x.Id);
table.ForeignKey(
name: "FK_Heartbeats_RoomInstance_RoomInstanceId",
column: x => x.RoomInstanceId,
principalTable: "RoomInstance",
principalColumn: "RoomInstanceId",
onDelete: ReferentialAction.SetNull);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_Heartbeats_RoomInstanceId",
table: "Heartbeats",
column: "RoomInstanceId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Heartbeats");
migrationBuilder.DropTable(
name: "RoomInstance");
}
}
}