DB added and more
This commit is contained in:
65
TOOHUCardAPI/Migrations/20211028202203_initial.cs
Normal file
65
TOOHUCardAPI/Migrations/20211028202203_initial.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace TOOHUCardAPI.Migrations
|
||||
{
|
||||
public partial class initial : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Users",
|
||||
columns: table => new
|
||||
{
|
||||
SteamId = table.Column<string>(type: "TEXT", nullable: false),
|
||||
MaxWave = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
MaxTeamWave = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
PetLevel = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
EndTime = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
KeyTotal = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
KeySaveDate = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
Vip = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
Point = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
LevelList = table.Column<string>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Users", x => x.SteamId);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EncodedCardGroup",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
EncodedString = table.Column<string>(type: "TEXT", nullable: true),
|
||||
UserSteamId = table.Column<string>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EncodedCardGroup", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_EncodedCardGroup_Users_UserSteamId",
|
||||
column: x => x.UserSteamId,
|
||||
principalTable: "Users",
|
||||
principalColumn: "SteamId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EncodedCardGroup_UserSteamId",
|
||||
table: "EncodedCardGroup",
|
||||
column: "UserSteamId");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "EncodedCardGroup");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Users");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user