// // Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Server.DB.Migrations; /// public partial class AddInventoryToCharacter : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "InventoryItem", columns: table => new { Id = table.Column(type: "uuid", nullable: false), CharacterId = table.Column(type: "uuid", nullable: false), ItemId = table.Column(type: "smallint", nullable: false), Count = table.Column(type: "integer", nullable: false), Slot = table.Column(type: "smallint", nullable: false), ItemType = table.Column(type: "smallint", nullable: false), Level = table.Column(type: "smallint", nullable: false), Rarity = table.Column(type: "smallint", nullable: false), AddOption = table.Column(type: "smallint", nullable: false), AddOption2 = table.Column(type: "smallint", nullable: false), AddOption3 = table.Column(type: "smallint", nullable: false), Option = table.Column(type: "smallint", nullable: false), Option2 = table.Column(type: "smallint", nullable: false), Option3 = table.Column(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"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "InventoryItem"); } }