Lots of additions and restructuring
This commit is contained in:
56
TOOHUCardAPI/Migrations/20211031004851_cardlevel.cs
Normal file
56
TOOHUCardAPI/Migrations/20211031004851_cardlevel.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user