Files
API/TOOHUCardAPI/Migrations/20211028202203_initial.cs
2021-10-28 17:03:15 -04:00

66 lines
2.7 KiB
C#

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");
}
}
}