2024-02-07 15:40:36 +00:00
|
|
|
// Licensed to Timothy Schenk under the GNU AGPL Version 3 License.
|
2023-11-20 18:58:30 +00:00
|
|
|
|
2023-11-08 14:39:25 +00:00
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
|
|
|
namespace Server.DB.Migrations;
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
2025-01-16 13:30:40 +00:00
|
|
|
public partial class AddInventoryToCharacter : Migration {
|
2023-11-08 14:39:25 +00:00
|
|
|
/// <inheritdoc />
|
2025-01-16 13:30:40 +00:00
|
|
|
protected override void Up(MigrationBuilder migrationBuilder) {
|
2023-11-08 14:39:25 +00:00
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
name: "InventoryItem",
|
2025-01-16 13:30:40 +00:00
|
|
|
columns: table => new {
|
2023-11-08 14:39:25 +00:00
|
|
|
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)
|
|
|
|
},
|
2025-01-16 13:30:40 +00:00
|
|
|
constraints: table => {
|
2023-11-08 14:39:25 +00:00
|
|
|
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 />
|
2025-01-16 13:30:40 +00:00
|
|
|
protected override void Down(MigrationBuilder migrationBuilder) {
|
2023-11-08 14:39:25 +00:00
|
|
|
migrationBuilder.DropTable(
|
|
|
|
name: "InventoryItem");
|
|
|
|
}
|
|
|
|
}
|