mirror of
https://github.com/TomasiDeveloping/PlayerManagement.git
synced 2026-04-16 17:22:21 +00:00
789 lines
36 KiB
C#
789 lines
36 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
|
|
|
namespace Database.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class Init : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.EnsureSchema(
|
|
name: "dbo");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Alliances",
|
|
schema: "dbo",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
Server = table.Column<int>(type: "int", nullable: false),
|
|
Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
|
|
Abbreviation = table.Column<string>(type: "nvarchar(5)", maxLength: 5, nullable: false),
|
|
CreatedOn = table.Column<DateTime>(type: "datetime2", nullable: false, defaultValue: new DateTime(2024, 11, 13, 13, 42, 40, 84, DateTimeKind.Local).AddTicks(3748)),
|
|
ModifiedOn = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
ModifiedBy = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Alliances", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Ranks",
|
|
schema: "dbo",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
Name = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Ranks", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Roles",
|
|
schema: "dbo",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
Name = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
|
NormalizedName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Roles", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "CustomEvents",
|
|
schema: "dbo",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
AllianceId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
Name = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: false),
|
|
Description = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false),
|
|
IsPointsEvent = table.Column<bool>(type: "bit", nullable: false),
|
|
IsParticipationEvent = table.Column<bool>(type: "bit", nullable: false),
|
|
EventDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
CreatedBy = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: false),
|
|
ModifiedOn = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
ModifiedBy = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_CustomEvents", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_CustomEvents_Alliances_AllianceId",
|
|
column: x => x.AllianceId,
|
|
principalSchema: "dbo",
|
|
principalTable: "Alliances",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "DesertStorms",
|
|
schema: "dbo",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
AllianceId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
EventDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
CreatedBy = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: false),
|
|
ModifiedOn = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
ModifiedBy = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true),
|
|
Won = table.Column<bool>(type: "bit", nullable: false),
|
|
OpponentName = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: false),
|
|
OpponentServer = table.Column<int>(type: "int", nullable: false),
|
|
OpposingParticipants = table.Column<int>(type: "int", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_DesertStorms", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_DesertStorms_Alliances_AllianceId",
|
|
column: x => x.AllianceId,
|
|
principalSchema: "dbo",
|
|
principalTable: "Alliances",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "MarshalGuards",
|
|
schema: "dbo",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
AllianceId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
EventDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
CreatedBy = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: false),
|
|
ModifiedOn = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
ModifiedBy = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true),
|
|
Level = table.Column<int>(type: "int", nullable: false),
|
|
RewardPhase = table.Column<int>(type: "int", nullable: false),
|
|
AllianceSize = table.Column<int>(type: "int", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_MarshalGuards", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_MarshalGuards_Alliances_AllianceId",
|
|
column: x => x.AllianceId,
|
|
principalSchema: "dbo",
|
|
principalTable: "Alliances",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Users",
|
|
schema: "dbo",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
AllianceId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
PlayerName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
|
|
UserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
|
NormalizedUserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
|
Email = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
|
NormalizedEmail = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
|
EmailConfirmed = table.Column<bool>(type: "bit", nullable: false),
|
|
PasswordHash = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
SecurityStamp = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
PhoneNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
PhoneNumberConfirmed = table.Column<bool>(type: "bit", nullable: false),
|
|
TwoFactorEnabled = table.Column<bool>(type: "bit", nullable: false),
|
|
LockoutEnd = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
|
|
LockoutEnabled = table.Column<bool>(type: "bit", nullable: false),
|
|
AccessFailedCount = table.Column<int>(type: "int", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Users", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_Users_Alliances_AllianceId",
|
|
column: x => x.AllianceId,
|
|
principalSchema: "dbo",
|
|
principalTable: "Alliances",
|
|
principalColumn: "Id");
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "VsDuels",
|
|
schema: "dbo",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
AllianceId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
EventDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
CreatedBy = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: false),
|
|
ModifiedOn = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
ModifiedBy = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true),
|
|
Won = table.Column<bool>(type: "bit", nullable: false),
|
|
OpponentName = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: false),
|
|
OpponentServer = table.Column<int>(type: "int", nullable: false),
|
|
OpponentPower = table.Column<long>(type: "bigint", nullable: false),
|
|
OpponentSize = table.Column<int>(type: "int", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_VsDuels", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_VsDuels_Alliances_AllianceId",
|
|
column: x => x.AllianceId,
|
|
principalSchema: "dbo",
|
|
principalTable: "Alliances",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Players",
|
|
schema: "dbo",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
PlayerName = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
|
|
RankId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
AllianceId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
Level = table.Column<int>(type: "int", nullable: false),
|
|
CreatedOn = table.Column<DateTime>(type: "datetime2", nullable: false, defaultValue: new DateTime(2024, 11, 13, 13, 42, 40, 96, DateTimeKind.Local).AddTicks(5768)),
|
|
CreatedBy = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: false),
|
|
ModifiedOn = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
ModifiedBy = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Players", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_Players_Alliances_AllianceId",
|
|
column: x => x.AllianceId,
|
|
principalSchema: "dbo",
|
|
principalTable: "Alliances",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "FK_Players_Ranks_RankId",
|
|
column: x => x.RankId,
|
|
principalSchema: "dbo",
|
|
principalTable: "Ranks",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "RoleClaims",
|
|
schema: "dbo",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
ClaimType = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
ClaimValue = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_RoleClaims", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_RoleClaims_Roles_RoleId",
|
|
column: x => x.RoleId,
|
|
principalSchema: "dbo",
|
|
principalTable: "Roles",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "UserClaims",
|
|
schema: "dbo",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
ClaimType = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
ClaimValue = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_UserClaims", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_UserClaims_Users_UserId",
|
|
column: x => x.UserId,
|
|
principalSchema: "dbo",
|
|
principalTable: "Users",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "UserLogins",
|
|
schema: "dbo",
|
|
columns: table => new
|
|
{
|
|
LoginProvider = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
|
ProviderKey = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
|
ProviderDisplayName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_UserLogins", x => new { x.LoginProvider, x.ProviderKey });
|
|
table.ForeignKey(
|
|
name: "FK_UserLogins_Users_UserId",
|
|
column: x => x.UserId,
|
|
principalSchema: "dbo",
|
|
principalTable: "Users",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "UserRoles",
|
|
schema: "dbo",
|
|
columns: table => new
|
|
{
|
|
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_UserRoles", x => new { x.UserId, x.RoleId });
|
|
table.ForeignKey(
|
|
name: "FK_UserRoles_Roles_RoleId",
|
|
column: x => x.RoleId,
|
|
principalSchema: "dbo",
|
|
principalTable: "Roles",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "FK_UserRoles_Users_UserId",
|
|
column: x => x.UserId,
|
|
principalSchema: "dbo",
|
|
principalTable: "Users",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "UserTokens",
|
|
schema: "dbo",
|
|
columns: table => new
|
|
{
|
|
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
LoginProvider = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
|
Name = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
|
Value = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_UserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
|
|
table.ForeignKey(
|
|
name: "FK_UserTokens_Users_UserId",
|
|
column: x => x.UserId,
|
|
principalSchema: "dbo",
|
|
principalTable: "Users",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Admonitions",
|
|
schema: "dbo",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
Reason = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
|
|
CreatedOn = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
CreatedBy = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: false),
|
|
ModifiedOn = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
ModifiedBy = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true),
|
|
PlayerId = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Admonitions", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_Admonitions_Players_PlayerId",
|
|
column: x => x.PlayerId,
|
|
principalSchema: "dbo",
|
|
principalTable: "Players",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "CustomEventParticipants",
|
|
schema: "dbo",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
PlayerId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
CustomEventId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
Participated = table.Column<bool>(type: "bit", nullable: true),
|
|
AchievedPoints = table.Column<int>(type: "int", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_CustomEventParticipants", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_CustomEventParticipants_CustomEvents_CustomEventId",
|
|
column: x => x.CustomEventId,
|
|
principalSchema: "dbo",
|
|
principalTable: "CustomEvents",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "FK_CustomEventParticipants_Players_PlayerId",
|
|
column: x => x.PlayerId,
|
|
principalSchema: "dbo",
|
|
principalTable: "Players",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Restrict);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "DesertStormParticipants",
|
|
schema: "dbo",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
PlayerId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
DesertStormId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
Registered = table.Column<bool>(type: "bit", nullable: false),
|
|
Participated = table.Column<bool>(type: "bit", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_DesertStormParticipants", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_DesertStormParticipants_DesertStorms_DesertStormId",
|
|
column: x => x.DesertStormId,
|
|
principalSchema: "dbo",
|
|
principalTable: "DesertStorms",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "FK_DesertStormParticipants_Players_PlayerId",
|
|
column: x => x.PlayerId,
|
|
principalSchema: "dbo",
|
|
principalTable: "Players",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Restrict);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "MarshalGuardParticipants",
|
|
schema: "dbo",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
PlayerId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
MarshalGuardId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
Participated = table.Column<bool>(type: "bit", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_MarshalGuardParticipants", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_MarshalGuardParticipants_MarshalGuards_MarshalGuardId",
|
|
column: x => x.MarshalGuardId,
|
|
principalSchema: "dbo",
|
|
principalTable: "MarshalGuards",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "FK_MarshalGuardParticipants_Players_PlayerId",
|
|
column: x => x.PlayerId,
|
|
principalSchema: "dbo",
|
|
principalTable: "Players",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Restrict);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Notes",
|
|
schema: "dbo",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
PlayerNote = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false),
|
|
CreatedOn = table.Column<DateTime>(type: "datetime2", nullable: false, defaultValue: new DateTime(2024, 11, 13, 13, 42, 40, 95, DateTimeKind.Local).AddTicks(4388)),
|
|
CreatedBy = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: false),
|
|
ModifiedOn = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
ModifiedBy = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true),
|
|
PlayerId = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Notes", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_Notes_Players_PlayerId",
|
|
column: x => x.PlayerId,
|
|
principalSchema: "dbo",
|
|
principalTable: "Players",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "VsDuelParticipants",
|
|
schema: "dbo",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
PlayerId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
VsDuelId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
WeeklyPoints = table.Column<int>(type: "int", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_VsDuelParticipants", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_VsDuelParticipants_Players_PlayerId",
|
|
column: x => x.PlayerId,
|
|
principalSchema: "dbo",
|
|
principalTable: "Players",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Restrict);
|
|
table.ForeignKey(
|
|
name: "FK_VsDuelParticipants_VsDuels_VsDuelId",
|
|
column: x => x.VsDuelId,
|
|
principalSchema: "dbo",
|
|
principalTable: "VsDuels",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.InsertData(
|
|
schema: "dbo",
|
|
table: "Ranks",
|
|
columns: new[] { "Id", "Name" },
|
|
values: new object[,]
|
|
{
|
|
{ new Guid("0fc2f68a-0a4d-4922-981e-c624e4c39024"), "R4" },
|
|
{ new Guid("326edef0-5074-43a5-9db9-edc71221a0f7"), "R1" },
|
|
{ new Guid("4970e1f5-f7f5-43e8-88cc-7f8fc4075418"), "R3" },
|
|
{ new Guid("b1c10a1c-5cf3-4e22-9fc1-d9b165b85dd3"), "R5" },
|
|
{ new Guid("d8d0c587-f269-45ff-b13e-4631298bf0af"), "R2" }
|
|
});
|
|
|
|
migrationBuilder.InsertData(
|
|
schema: "dbo",
|
|
table: "Roles",
|
|
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
|
values: new object[,]
|
|
{
|
|
{ new Guid("207bb0a3-ad50-49bb-bc41-b266fce66529"), null, "ReadOnly", "READONLY" },
|
|
{ new Guid("47de05ba-ff1e-46b6-9995-269084006c24"), null, "Administrator", "ADMINISTRATOR" },
|
|
{ new Guid("5cc27946-5601-4a25-b9a9-75b8a11c0cf4"), null, "User", "USER" },
|
|
{ new Guid("d8b9f882-95f0-4ba0-80ed-9c22c27ac88a"), null, "SystemAdministrator", "SYSTEMADMINISTRATOR" }
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Admonitions_PlayerId",
|
|
schema: "dbo",
|
|
table: "Admonitions",
|
|
column: "PlayerId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_CustomEventParticipants_CustomEventId",
|
|
schema: "dbo",
|
|
table: "CustomEventParticipants",
|
|
column: "CustomEventId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_CustomEventParticipants_PlayerId",
|
|
schema: "dbo",
|
|
table: "CustomEventParticipants",
|
|
column: "PlayerId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_CustomEvents_AllianceId",
|
|
schema: "dbo",
|
|
table: "CustomEvents",
|
|
column: "AllianceId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_DesertStormParticipants_DesertStormId",
|
|
schema: "dbo",
|
|
table: "DesertStormParticipants",
|
|
column: "DesertStormId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_DesertStormParticipants_PlayerId",
|
|
schema: "dbo",
|
|
table: "DesertStormParticipants",
|
|
column: "PlayerId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_DesertStorms_AllianceId",
|
|
schema: "dbo",
|
|
table: "DesertStorms",
|
|
column: "AllianceId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_MarshalGuardParticipants_MarshalGuardId",
|
|
schema: "dbo",
|
|
table: "MarshalGuardParticipants",
|
|
column: "MarshalGuardId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_MarshalGuardParticipants_PlayerId",
|
|
schema: "dbo",
|
|
table: "MarshalGuardParticipants",
|
|
column: "PlayerId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_MarshalGuards_AllianceId",
|
|
schema: "dbo",
|
|
table: "MarshalGuards",
|
|
column: "AllianceId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Notes_PlayerId",
|
|
schema: "dbo",
|
|
table: "Notes",
|
|
column: "PlayerId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Players_AllianceId",
|
|
schema: "dbo",
|
|
table: "Players",
|
|
column: "AllianceId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Players_RankId",
|
|
schema: "dbo",
|
|
table: "Players",
|
|
column: "RankId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_RoleClaims_RoleId",
|
|
schema: "dbo",
|
|
table: "RoleClaims",
|
|
column: "RoleId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "RoleNameIndex",
|
|
schema: "dbo",
|
|
table: "Roles",
|
|
column: "NormalizedName",
|
|
unique: true,
|
|
filter: "[NormalizedName] IS NOT NULL");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_UserClaims_UserId",
|
|
schema: "dbo",
|
|
table: "UserClaims",
|
|
column: "UserId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_UserLogins_UserId",
|
|
schema: "dbo",
|
|
table: "UserLogins",
|
|
column: "UserId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_UserRoles_RoleId",
|
|
schema: "dbo",
|
|
table: "UserRoles",
|
|
column: "RoleId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "EmailIndex",
|
|
schema: "dbo",
|
|
table: "Users",
|
|
column: "NormalizedEmail");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Users_AllianceId",
|
|
schema: "dbo",
|
|
table: "Users",
|
|
column: "AllianceId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "UserNameIndex",
|
|
schema: "dbo",
|
|
table: "Users",
|
|
column: "NormalizedUserName",
|
|
unique: true,
|
|
filter: "[NormalizedUserName] IS NOT NULL");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_VsDuelParticipants_PlayerId",
|
|
schema: "dbo",
|
|
table: "VsDuelParticipants",
|
|
column: "PlayerId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_VsDuelParticipants_VsDuelId",
|
|
schema: "dbo",
|
|
table: "VsDuelParticipants",
|
|
column: "VsDuelId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_VsDuels_AllianceId",
|
|
schema: "dbo",
|
|
table: "VsDuels",
|
|
column: "AllianceId");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "Admonitions",
|
|
schema: "dbo");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "CustomEventParticipants",
|
|
schema: "dbo");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "DesertStormParticipants",
|
|
schema: "dbo");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "MarshalGuardParticipants",
|
|
schema: "dbo");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Notes",
|
|
schema: "dbo");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "RoleClaims",
|
|
schema: "dbo");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "UserClaims",
|
|
schema: "dbo");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "UserLogins",
|
|
schema: "dbo");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "UserRoles",
|
|
schema: "dbo");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "UserTokens",
|
|
schema: "dbo");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "VsDuelParticipants",
|
|
schema: "dbo");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "CustomEvents",
|
|
schema: "dbo");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "DesertStorms",
|
|
schema: "dbo");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "MarshalGuards",
|
|
schema: "dbo");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Roles",
|
|
schema: "dbo");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Users",
|
|
schema: "dbo");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Players",
|
|
schema: "dbo");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "VsDuels",
|
|
schema: "dbo");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Ranks",
|
|
schema: "dbo");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Alliances",
|
|
schema: "dbo");
|
|
}
|
|
}
|
|
}
|