forked from Raphael/SCHALE.GameServer
77 lines
2.9 KiB
C#
77 lines
2.9 KiB
C#
|
using System;
|
|||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace SCHALE.Common.Migrations
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
public partial class MemoryLobby_and_Scenario : Migration
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.CreateTable(
|
|||
|
name: "MemoryLobbies",
|
|||
|
columns: table => new
|
|||
|
{
|
|||
|
ServerId = table.Column<long>(type: "bigint", nullable: false)
|
|||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|||
|
AccountServerId = table.Column<long>(type: "bigint", nullable: false),
|
|||
|
MemoryLobbyUniqueId = table.Column<long>(type: "bigint", nullable: false)
|
|||
|
},
|
|||
|
constraints: table =>
|
|||
|
{
|
|||
|
table.PrimaryKey("PK_MemoryLobbies", x => x.ServerId);
|
|||
|
table.ForeignKey(
|
|||
|
name: "FK_MemoryLobbies_Accounts_AccountServerId",
|
|||
|
column: x => x.AccountServerId,
|
|||
|
principalTable: "Accounts",
|
|||
|
principalColumn: "ServerId",
|
|||
|
onDelete: ReferentialAction.Cascade);
|
|||
|
});
|
|||
|
|
|||
|
migrationBuilder.CreateTable(
|
|||
|
name: "Scenarios",
|
|||
|
columns: table => new
|
|||
|
{
|
|||
|
ServerId = table.Column<long>(type: "bigint", nullable: false)
|
|||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|||
|
AccountServerId = table.Column<long>(type: "bigint", nullable: false),
|
|||
|
ScenarioUniqueId = table.Column<long>(type: "bigint", nullable: false),
|
|||
|
ClearDateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
|||
|
},
|
|||
|
constraints: table =>
|
|||
|
{
|
|||
|
table.PrimaryKey("PK_Scenarios", x => x.ServerId);
|
|||
|
table.ForeignKey(
|
|||
|
name: "FK_Scenarios_Accounts_AccountServerId",
|
|||
|
column: x => x.AccountServerId,
|
|||
|
principalTable: "Accounts",
|
|||
|
principalColumn: "ServerId",
|
|||
|
onDelete: ReferentialAction.Cascade);
|
|||
|
});
|
|||
|
|
|||
|
migrationBuilder.CreateIndex(
|
|||
|
name: "IX_MemoryLobbies_AccountServerId",
|
|||
|
table: "MemoryLobbies",
|
|||
|
column: "AccountServerId");
|
|||
|
|
|||
|
migrationBuilder.CreateIndex(
|
|||
|
name: "IX_Scenarios_AccountServerId",
|
|||
|
table: "Scenarios",
|
|||
|
column: "AccountServerId");
|
|||
|
}
|
|||
|
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropTable(
|
|||
|
name: "MemoryLobbies");
|
|||
|
|
|||
|
migrationBuilder.DropTable(
|
|||
|
name: "Scenarios");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|