forked from Raphael/SCHALE.GameServer
91 lines
4.1 KiB
C#
91 lines
4.1 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace SCHALE.Common.Migrations.SqlServerMigrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class CafeAndFurnitures : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "Cafes",
|
|
columns: table => new
|
|
{
|
|
CafeDBId = table.Column<long>(type: "bigint", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
AccountServerId = table.Column<long>(type: "bigint", nullable: false),
|
|
CafeId = table.Column<long>(type: "bigint", nullable: false),
|
|
AccountId = table.Column<long>(type: "bigint", nullable: false),
|
|
CafeRank = table.Column<int>(type: "int", nullable: false),
|
|
LastUpdate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
LastSummonDate = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
CafeVisitCharacterDBs = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
ProductionAppliedTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
CurrencyDict_Obsolete = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
UpdateTimeDict_Obsolete = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Cafes", x => x.CafeDBId);
|
|
table.ForeignKey(
|
|
name: "FK_Cafes_Accounts_AccountServerId",
|
|
column: x => x.AccountServerId,
|
|
principalTable: "Accounts",
|
|
principalColumn: "ServerId",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Furnitures",
|
|
columns: table => new
|
|
{
|
|
ServerId = table.Column<long>(type: "bigint", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
Location = table.Column<int>(type: "int", nullable: false),
|
|
CafeDBId = table.Column<long>(type: "bigint", nullable: false),
|
|
PositionX = table.Column<float>(type: "real", nullable: false),
|
|
PositionY = table.Column<float>(type: "real", nullable: false),
|
|
Rotation = table.Column<float>(type: "real", nullable: false),
|
|
ItemDeploySequence = table.Column<long>(type: "bigint", nullable: false),
|
|
AccountServerId = table.Column<long>(type: "bigint", nullable: false),
|
|
UniqueId = table.Column<long>(type: "bigint", nullable: false),
|
|
StackCount = table.Column<long>(type: "bigint", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Furnitures", x => x.ServerId);
|
|
table.ForeignKey(
|
|
name: "FK_Furnitures_Accounts_AccountServerId",
|
|
column: x => x.AccountServerId,
|
|
principalTable: "Accounts",
|
|
principalColumn: "ServerId",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Cafes_AccountServerId",
|
|
table: "Cafes",
|
|
column: "AccountServerId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Furnitures_AccountServerId",
|
|
table: "Furnitures",
|
|
column: "AccountServerId");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "Cafes");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Furnitures");
|
|
}
|
|
}
|
|
}
|