using System; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace DeluxeNET.Migrations { /// public partial class heartbeatData : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "RoomInstance", columns: table => new { RoomInstanceId = table.Column(type: "bigint", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), RoomId = table.Column(type: "bigint", nullable: false), SubRoomId = table.Column(type: "bigint", nullable: false), Location = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), RoomInstanceType = table.Column(type: "int", nullable: false), PhotonRegionId = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), PhotonRegion = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), PhotonRoomId = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Name = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), MaxCapacity = table.Column(type: "int", nullable: false), IsFull = table.Column(type: "tinyint(1)", nullable: false), IsPrivate = table.Column(type: "tinyint(1)", nullable: false), IsInProgress = table.Column(type: "tinyint(1)", nullable: false), MatchmakingPolicy = table.Column(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(type: "bigint", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), PlayerId = table.Column(type: "bigint", nullable: false), StatusVisibility = table.Column(type: "int", nullable: false), Platform = table.Column(type: "int", nullable: false), DeviceClass = table.Column(type: "int", nullable: false), RoomInstanceId = table.Column(type: "bigint", nullable: true), VrMovementMode = table.Column(type: "int", nullable: false), LastOnline = table.Column(type: "datetime(6)", nullable: false), IsOnline = table.Column(type: "tinyint(1)", nullable: false), AppVersion = table.Column(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"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Heartbeats"); migrationBuilder.DropTable( name: "RoomInstance"); } } }