Lots of additions and restructuring

This commit is contained in:
2021-10-30 21:58:43 -04:00
parent 9cf11e982f
commit 20cac8c378
37 changed files with 4465 additions and 117 deletions

View File

@@ -0,0 +1,56 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace TOOHUCardAPI.Migrations
{
public partial class cardlevel : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "LevelList",
table: "Users");
migrationBuilder.CreateTable(
name: "CardLevel",
columns: table => new
{
UserSteamId = table.Column<string>(type: "TEXT", nullable: false),
CardItemCode = table.Column<string>(type: "TEXT", nullable: false),
Level = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CardLevel", x => new { x.UserSteamId, x.CardItemCode });
table.ForeignKey(
name: "FK_CardLevel_Cards_CardItemCode",
column: x => x.CardItemCode,
principalTable: "Cards",
principalColumn: "ItemCode",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_CardLevel_Users_UserSteamId",
column: x => x.UserSteamId,
principalTable: "Users",
principalColumn: "SteamId",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_CardLevel_CardItemCode",
table: "CardLevel",
column: "CardItemCode");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CardLevel");
migrationBuilder.AddColumn<string>(
name: "LevelList",
table: "Users",
type: "TEXT",
nullable: true);
}
}
}