continuity/Continuity.AuthServer/DB/Migrations/20231108143729_AddInventoryToCharacter.cs
Timothy Schenk 1363ddf8fe
Some checks failed
Build, Package and Push Images / preprocess (push) Successful in 2s
Build, Package and Push Images / build (push) Successful in 25s
Build, Package and Push Images / sbom-scan (push) Successful in 35s
Build, Package and Push Images / container-build (push) Failing after 56s
Build, Package and Push Images / container-sbom-scan (push) Has been skipped
Build, Package and Push Images / sonarqube (push) Successful in 1m20s
refactor: rename to Continuity.AuthServer
2023-11-28 15:38:28 +01:00

57 lines
2.3 KiB
C#

// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License.
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Server.DB.Migrations;
/// <inheritdoc />
public partial class AddInventoryToCharacter : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "InventoryItem",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
CharacterId = table.Column<Guid>(type: "uuid", nullable: false),
ItemId = table.Column<short>(type: "smallint", nullable: false),
Count = table.Column<int>(type: "integer", nullable: false),
Slot = table.Column<byte>(type: "smallint", nullable: false),
ItemType = table.Column<byte>(type: "smallint", nullable: false),
Level = table.Column<byte>(type: "smallint", nullable: false),
Rarity = table.Column<byte>(type: "smallint", nullable: false),
AddOption = table.Column<byte>(type: "smallint", nullable: false),
AddOption2 = table.Column<byte>(type: "smallint", nullable: false),
AddOption3 = table.Column<byte>(type: "smallint", nullable: false),
Option = table.Column<short>(type: "smallint", nullable: false),
Option2 = table.Column<short>(type: "smallint", nullable: false),
Option3 = table.Column<short>(type: "smallint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_InventoryItem", x => x.Id);
table.ForeignKey(
name: "FK_InventoryItem_Characters_CharacterId",
column: x => x.CharacterId,
principalTable: "Characters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_InventoryItem_CharacterId",
table: "InventoryItem",
column: "CharacterId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "InventoryItem");
}
}