using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace SVSim.Database.Migrations
{
///
public partial class AddArenaTwoPick : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ArenaTwoPickRewards",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
WinCount = table.Column(type: "integer", nullable: false),
RewardType = table.Column(type: "integer", nullable: false),
RewardId = table.Column(type: "bigint", nullable: false),
RewardNum = table.Column(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ArenaTwoPickRewards", x => x.Id);
});
migrationBuilder.CreateTable(
name: "ViewerArenaTwoPickRuns",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
ViewerId = table.Column(type: "bigint", nullable: false),
EntryId = table.Column(type: "bigint", nullable: false),
RewardScheduleId = table.Column(type: "integer", nullable: false),
ChallengeId = table.Column(type: "integer", nullable: false),
MaxBattleCount = table.Column(type: "integer", nullable: false),
ClassId = table.Column(type: "integer", nullable: false),
LeaderSkinId = table.Column(type: "bigint", nullable: false),
CandidateClassIdsJson = table.Column(type: "jsonb", nullable: false),
SelectTurn = table.Column(type: "integer", nullable: false),
IsSelectCompleted = table.Column(type: "boolean", nullable: false),
SelectedCardIdsJson = table.Column(type: "jsonb", nullable: false),
PendingPickSetsJson = table.Column(type: "jsonb", nullable: false),
NextCandidateId = table.Column(type: "bigint", nullable: false),
ResultListJson = table.Column(type: "jsonb", nullable: false),
WinCount = table.Column(type: "integer", nullable: false),
LossCount = table.Column(type: "integer", nullable: false),
IsRetire = table.Column(type: "boolean", nullable: false),
CreatedAt = table.Column(type: "timestamp with time zone", nullable: false),
UpdatedAt = table.Column(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ViewerArenaTwoPickRuns", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_ArenaTwoPickRewards_WinCount",
table: "ArenaTwoPickRewards",
column: "WinCount");
migrationBuilder.CreateIndex(
name: "IX_ArenaTwoPickRewards_WinCount_RewardType_RewardId",
table: "ArenaTwoPickRewards",
columns: new[] { "WinCount", "RewardType", "RewardId" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_ViewerArenaTwoPickRuns_ViewerId",
table: "ViewerArenaTwoPickRuns",
column: "ViewerId",
unique: true);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ArenaTwoPickRewards");
migrationBuilder.DropTable(
name: "ViewerArenaTwoPickRuns");
}
}
}