rank endpoint done

This commit is contained in:
2021-11-07 14:00:18 -05:00
parent e232accdb1
commit e14f7fae74
18 changed files with 2536 additions and 25 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,71 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace TOOHUCardAPI.Migrations
{
public partial class newfields : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "AccountId",
table: "RankEntries");
migrationBuilder.DropColumn(
name: "Username",
table: "RankEntries");
migrationBuilder.AddColumn<long>(
name: "AccountId",
table: "Users",
type: "bigint",
nullable: false,
defaultValue: 0L);
migrationBuilder.AddColumn<string>(
name: "Username",
table: "Users",
type: "text",
nullable: true);
migrationBuilder.AlterColumn<float>(
name: "Damage",
table: "RankEntries",
type: "real",
nullable: false,
oldClrType: typeof(long),
oldType: "bigint");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "AccountId",
table: "Users");
migrationBuilder.DropColumn(
name: "Username",
table: "Users");
migrationBuilder.AlterColumn<long>(
name: "Damage",
table: "RankEntries",
type: "bigint",
nullable: false,
oldClrType: typeof(float),
oldType: "real");
migrationBuilder.AddColumn<long>(
name: "AccountId",
table: "RankEntries",
type: "bigint",
nullable: false,
defaultValue: 0L);
migrationBuilder.AddColumn<string>(
name: "Username",
table: "RankEntries",
type: "text",
nullable: true);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,97 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace TOOHUCardAPI.Migrations
{
public partial class cascadedeletechildren : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_EncodedCardGroup_Users_UserSteamId",
table: "EncodedCardGroup");
migrationBuilder.DropForeignKey(
name: "FK_RankTowerEntry_RankEntries_RankEntryId",
table: "RankTowerEntry");
migrationBuilder.AlterColumn<int>(
name: "RankEntryId",
table: "RankTowerEntry",
type: "integer",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "integer",
oldNullable: true);
migrationBuilder.AlterColumn<long>(
name: "UserSteamId",
table: "EncodedCardGroup",
type: "bigint",
nullable: false,
defaultValue: 0L,
oldClrType: typeof(long),
oldType: "bigint",
oldNullable: true);
migrationBuilder.AddForeignKey(
name: "FK_EncodedCardGroup_Users_UserSteamId",
table: "EncodedCardGroup",
column: "UserSteamId",
principalTable: "Users",
principalColumn: "SteamId",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_RankTowerEntry_RankEntries_RankEntryId",
table: "RankTowerEntry",
column: "RankEntryId",
principalTable: "RankEntries",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_EncodedCardGroup_Users_UserSteamId",
table: "EncodedCardGroup");
migrationBuilder.DropForeignKey(
name: "FK_RankTowerEntry_RankEntries_RankEntryId",
table: "RankTowerEntry");
migrationBuilder.AlterColumn<int>(
name: "RankEntryId",
table: "RankTowerEntry",
type: "integer",
nullable: true,
oldClrType: typeof(int),
oldType: "integer");
migrationBuilder.AlterColumn<long>(
name: "UserSteamId",
table: "EncodedCardGroup",
type: "bigint",
nullable: true,
oldClrType: typeof(long),
oldType: "bigint");
migrationBuilder.AddForeignKey(
name: "FK_EncodedCardGroup_Users_UserSteamId",
table: "EncodedCardGroup",
column: "UserSteamId",
principalTable: "Users",
principalColumn: "SteamId",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_RankTowerEntry_RankEntries_RankEntryId",
table: "RankTowerEntry",
column: "RankEntryId",
principalTable: "RankEntries",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
}
}

View File

@@ -930,7 +930,7 @@ namespace TOOHUCardAPI.Migrations
b.Property<string>("GroupKey")
.HasColumnType("text");
b.Property<long?>("UserSteamId")
b.Property<long>("UserSteamId")
.HasColumnType("bigint");
b.HasKey("Id");
@@ -947,11 +947,8 @@ namespace TOOHUCardAPI.Migrations
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<long>("AccountId")
.HasColumnType("bigint");
b.Property<long>("Damage")
.HasColumnType("bigint");
b.Property<float>("Damage")
.HasColumnType("real");
b.Property<int>("RankType")
.HasColumnType("integer");
@@ -962,9 +959,6 @@ namespace TOOHUCardAPI.Migrations
b.Property<long?>("UserSteamId")
.HasColumnType("bigint");
b.Property<string>("Username")
.HasColumnType("text");
b.Property<string>("Version")
.HasColumnType("text");
@@ -988,7 +982,7 @@ namespace TOOHUCardAPI.Migrations
b.Property<string>("EncodedData")
.HasColumnType("text");
b.Property<int?>("RankEntryId")
b.Property<int>("RankEntryId")
.HasColumnType("integer");
b.Property<string>("TowerKey")
@@ -1008,6 +1002,9 @@ namespace TOOHUCardAPI.Migrations
.HasColumnType("bigint")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<long>("AccountId")
.HasColumnType("bigint");
b.Property<bool>("Ban")
.HasColumnType("boolean");
@@ -1050,6 +1047,9 @@ namespace TOOHUCardAPI.Migrations
b.Property<int>("PowerMaxTotal")
.HasColumnType("integer");
b.Property<string>("Username")
.HasColumnType("text");
b.Property<bool>("Vip")
.HasColumnType("boolean");
@@ -1079,7 +1079,9 @@ namespace TOOHUCardAPI.Migrations
{
b.HasOne("TOOHUCardAPI.Data.Models.User", null)
.WithMany("EncodedCardGroups")
.HasForeignKey("UserSteamId");
.HasForeignKey("UserSteamId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("TOOHUCardAPI.Data.Models.RankEntry", b =>
@@ -1095,7 +1097,9 @@ namespace TOOHUCardAPI.Migrations
{
b.HasOne("TOOHUCardAPI.Data.Models.RankEntry", null)
.WithMany("TowersUsed")
.HasForeignKey("RankEntryId");
.HasForeignKey("RankEntryId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("TOOHUCardAPI.Data.Models.RankEntry", b =>