LANCommander/LANCommander.Server.Data.PostgreSQL/Migrations/20250217231022_InitialMigration.cs
Pat Hartl 2e9843be40
Some checks failed
LANCommander Debug Build / deploy_server_win-x64 (push) Has been cancelled
Regenerate postgres migrations
2025-02-17 17:11:09 -06:00

2272 lines
104 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace LANCommander.Server.Data.PostgreSQL.Migrations
{
/// <inheritdoc />
public partial class InitialMigration : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Users",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
PasswordHash = table.Column<string>(type: "text", nullable: true),
SecurityStamp = table.Column<string>(type: "text", nullable: true),
Email = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
NormalizedEmail = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
EmailConfirmed = table.Column<bool>(type: "boolean", nullable: false),
NormalizedUserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
ConcurrencyStamp = table.Column<string>(type: "text", nullable: true),
PhoneNumber = table.Column<string>(type: "text", nullable: true),
PhoneNumberConfirmed = table.Column<bool>(type: "boolean", nullable: false),
TwoFactorEnabled = table.Column<bool>(type: "boolean", nullable: false),
LockoutEnd = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
LockoutEnabled = table.Column<bool>(type: "boolean", nullable: false),
AccessFailedCount = table.Column<int>(type: "integer", nullable: false),
RefreshToken = table.Column<string>(type: "text", nullable: true),
RefreshTokenExpiration = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
Approved = table.Column<bool>(type: "boolean", nullable: false),
ApprovedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
Alias = table.Column<string>(type: "text", nullable: true),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true),
UserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Users", x => x.Id);
table.ForeignKey(
name: "FK_Users_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Users_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "Categories",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
ParentId = table.Column<Guid>(type: "uuid", nullable: false),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true),
Name = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Categories", x => x.Id);
table.ForeignKey(
name: "FK_Categories_Categories_ParentId",
column: x => x.ParentId,
principalTable: "Categories",
principalColumn: "Id");
table.ForeignKey(
name: "FK_Categories_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Categories_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "Collections",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true),
Name = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Collections", x => x.Id);
table.ForeignKey(
name: "FK_Collections_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Collections_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "Companies",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "text", nullable: false),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Companies", x => x.Id);
table.ForeignKey(
name: "FK_Companies_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Companies_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "Engines",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true),
Name = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Engines", x => x.Id);
table.ForeignKey(
name: "FK_Engines_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id");
table.ForeignKey(
name: "FK_Engines_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "Genres",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true),
Name = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Genres", x => x.Id);
table.ForeignKey(
name: "FK_Genres_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Genres_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "Libraries",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
UserId = table.Column<Guid>(type: "uuid", nullable: false),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Libraries", x => x.Id);
table.ForeignKey(
name: "FK_Libraries_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Libraries_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Libraries_Users_UserId",
column: x => x.UserId,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Pages",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Title = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
Slug = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
Route = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: false),
Contents = table.Column<string>(type: "text", nullable: false),
SortOrder = table.Column<int>(type: "integer", nullable: false),
ParentId = table.Column<Guid>(type: "uuid", nullable: true),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Pages", x => x.Id);
table.ForeignKey(
name: "FK_Pages_Pages_ParentId",
column: x => x.ParentId,
principalTable: "Pages",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Pages_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Pages_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "Platforms",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true),
Name = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Platforms", x => x.Id);
table.ForeignKey(
name: "FK_Platforms_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Platforms_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "Redistributables",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "text", nullable: false),
Description = table.Column<string>(type: "text", nullable: true),
Notes = table.Column<string>(type: "text", nullable: true),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Redistributables", x => x.Id);
table.ForeignKey(
name: "FK_Redistributables_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Redistributables_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "Roles",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true),
Name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
NormalizedName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
ConcurrencyStamp = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Roles", x => x.Id);
table.ForeignKey(
name: "FK_Roles_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Roles_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "StorageLocations",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Default = table.Column<bool>(type: "boolean", nullable: false),
Path = table.Column<string>(type: "text", nullable: false),
Type = table.Column<int>(type: "integer", nullable: false),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_StorageLocations", x => x.Id);
table.ForeignKey(
name: "FK_StorageLocations_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id");
table.ForeignKey(
name: "FK_StorageLocations_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "Tags",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true),
Name = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Tags", x => x.Id);
table.ForeignKey(
name: "FK_Tags_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Tags_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "UserClaims",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
UserId = table.Column<Guid>(type: "uuid", nullable: false),
ClaimType = table.Column<string>(type: "text", nullable: true),
ClaimValue = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_UserClaims", x => x.Id);
table.ForeignKey(
name: "FK_UserClaims_Users_UserId",
column: x => x.UserId,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "UserCustomField",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
Value = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
UserId = table.Column<Guid>(type: "uuid", nullable: false),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_UserCustomField", x => x.Id);
table.ForeignKey(
name: "FK_UserCustomField_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_UserCustomField_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_UserCustomField_Users_UserId",
column: x => x.UserId,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "UserLogins",
columns: table => new
{
LoginProvider = table.Column<string>(type: "text", nullable: false),
ProviderKey = table.Column<string>(type: "text", nullable: false),
ProviderDisplayName = table.Column<string>(type: "text", nullable: true),
UserId = table.Column<Guid>(type: "uuid", 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,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "UserTokens",
columns: table => new
{
UserId = table.Column<Guid>(type: "uuid", nullable: false),
LoginProvider = table.Column<string>(type: "text", nullable: false),
Name = table.Column<string>(type: "text", nullable: false),
Value = table.Column<string>(type: "text", 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,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Games",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
IGDBId = table.Column<long>(type: "bigint", nullable: true),
Title = table.Column<string>(type: "text", nullable: false),
SortTitle = table.Column<string>(type: "text", nullable: true),
DirectoryName = table.Column<string>(type: "text", nullable: true),
Description = table.Column<string>(type: "text", nullable: true),
Notes = table.Column<string>(type: "text", nullable: true),
ReleasedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
KeyAllocationMethod = table.Column<int>(type: "integer", nullable: false),
Type = table.Column<int>(type: "integer", nullable: false),
BaseGameId = table.Column<Guid>(type: "uuid", nullable: true),
Singleplayer = table.Column<bool>(type: "boolean", nullable: false),
EngineId = table.Column<Guid>(type: "uuid", nullable: true),
ValidKeyRegex = table.Column<string>(type: "text", nullable: true),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Games", x => x.Id);
table.ForeignKey(
name: "FK_Games_Engines_EngineId",
column: x => x.EngineId,
principalTable: "Engines",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Games_Games_BaseGameId",
column: x => x.BaseGameId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Games_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Games_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "PageRedistributable",
columns: table => new
{
PageId = table.Column<Guid>(type: "uuid", nullable: false),
RedistributableId = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PageRedistributable", x => new { x.PageId, x.RedistributableId });
table.ForeignKey(
name: "FK_PageRedistributable_Pages_PageId",
column: x => x.PageId,
principalTable: "Pages",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PageRedistributable_Redistributables_RedistributableId",
column: x => x.RedistributableId,
principalTable: "Redistributables",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "RoleClaims",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
RoleId = table.Column<Guid>(type: "uuid", nullable: false),
ClaimType = table.Column<string>(type: "text", nullable: true),
ClaimValue = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_RoleClaims", x => x.Id);
table.ForeignKey(
name: "FK_RoleClaims_Roles_RoleId",
column: x => x.RoleId,
principalTable: "Roles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "RoleCollection",
columns: table => new
{
CollectionId = table.Column<Guid>(type: "uuid", nullable: false),
RoleId = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_RoleCollection", x => new { x.CollectionId, x.RoleId });
table.ForeignKey(
name: "FK_RoleCollection_Collections_CollectionId",
column: x => x.CollectionId,
principalTable: "Collections",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_RoleCollection_Roles_RoleId",
column: x => x.RoleId,
principalTable: "Roles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "UserRoles",
columns: table => new
{
UserId = table.Column<Guid>(type: "uuid", nullable: false),
RoleId = table.Column<Guid>(type: "uuid", 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,
principalTable: "Roles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_UserRoles_Users_UserId",
column: x => x.UserId,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Archive",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Changelog = table.Column<string>(type: "text", nullable: true),
ObjectKey = table.Column<string>(type: "text", nullable: false),
Version = table.Column<string>(type: "text", nullable: false),
StorageLocationId = table.Column<Guid>(type: "uuid", nullable: false),
GameId = table.Column<Guid>(type: "uuid", nullable: true),
RedistributableId = table.Column<Guid>(type: "uuid", nullable: true),
LastVersionId = table.Column<Guid>(type: "uuid", nullable: true),
UncompressedSize = table.Column<long>(type: "bigint", nullable: false),
CompressedSize = table.Column<long>(type: "bigint", nullable: false),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Archive", x => x.Id);
table.ForeignKey(
name: "FK_Archive_Archive_LastVersionId",
column: x => x.LastVersionId,
principalTable: "Archive",
principalColumn: "Id");
table.ForeignKey(
name: "FK_Archive_Games_GameId",
column: x => x.GameId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Archive_Redistributables_RedistributableId",
column: x => x.RedistributableId,
principalTable: "Redistributables",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Archive_StorageLocations_StorageLocationId",
column: x => x.StorageLocationId,
principalTable: "StorageLocations",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Archive_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Archive_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "CategoryGame",
columns: table => new
{
CategoriesId = table.Column<Guid>(type: "uuid", nullable: false),
GamesId = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CategoryGame", x => new { x.CategoriesId, x.GamesId });
table.ForeignKey(
name: "FK_CategoryGame_Categories_CategoriesId",
column: x => x.CategoriesId,
principalTable: "Categories",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_CategoryGame_Games_GamesId",
column: x => x.GamesId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "CollectionGame",
columns: table => new
{
CollectionId = table.Column<Guid>(type: "uuid", nullable: false),
GameId = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CollectionGame", x => new { x.CollectionId, x.GameId });
table.ForeignKey(
name: "FK_CollectionGame_Collections_CollectionId",
column: x => x.CollectionId,
principalTable: "Collections",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_CollectionGame_Games_GameId",
column: x => x.GameId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "GameCustomField",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
Value = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
GameId = table.Column<Guid>(type: "uuid", nullable: true),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_GameCustomField", x => x.Id);
table.ForeignKey(
name: "FK_GameCustomField_Games_GameId",
column: x => x.GameId,
principalTable: "Games",
principalColumn: "Id");
table.ForeignKey(
name: "FK_GameCustomField_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id");
table.ForeignKey(
name: "FK_GameCustomField_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "GameDeveloper",
columns: table => new
{
GameId = table.Column<Guid>(type: "uuid", nullable: false),
DeveloperId = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_GameDeveloper", x => new { x.GameId, x.DeveloperId });
table.ForeignKey(
name: "FK_GameDeveloper_Companies_DeveloperId",
column: x => x.DeveloperId,
principalTable: "Companies",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_GameDeveloper_Games_GameId",
column: x => x.GameId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "GameGenre",
columns: table => new
{
GamesId = table.Column<Guid>(type: "uuid", nullable: false),
GenresId = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_GameGenre", x => new { x.GamesId, x.GenresId });
table.ForeignKey(
name: "FK_GameGenre_Games_GamesId",
column: x => x.GamesId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_GameGenre_Genres_GenresId",
column: x => x.GenresId,
principalTable: "Genres",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "GamePlatform",
columns: table => new
{
GamesId = table.Column<Guid>(type: "uuid", nullable: false),
PlatformsId = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_GamePlatform", x => new { x.GamesId, x.PlatformsId });
table.ForeignKey(
name: "FK_GamePlatform_Games_GamesId",
column: x => x.GamesId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_GamePlatform_Platforms_PlatformsId",
column: x => x.PlatformsId,
principalTable: "Platforms",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "GamePublisher",
columns: table => new
{
GameId = table.Column<Guid>(type: "uuid", nullable: false),
PublisherId = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_GamePublisher", x => new { x.GameId, x.PublisherId });
table.ForeignKey(
name: "FK_GamePublisher_Companies_PublisherId",
column: x => x.PublisherId,
principalTable: "Companies",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_GamePublisher_Games_GameId",
column: x => x.GameId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "GameRedistributable",
columns: table => new
{
GameId = table.Column<Guid>(type: "uuid", nullable: false),
RedistributableId = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_GameRedistributable", x => new { x.GameId, x.RedistributableId });
table.ForeignKey(
name: "FK_GameRedistributable_Games_GameId",
column: x => x.GameId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_GameRedistributable_Redistributables_RedistributableId",
column: x => x.RedistributableId,
principalTable: "Redistributables",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "GameSaves",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
StorageLocationId = table.Column<Guid>(type: "uuid", nullable: false),
Size = table.Column<long>(type: "bigint", nullable: false),
GameId = table.Column<Guid>(type: "uuid", nullable: true),
UserId = table.Column<Guid>(type: "uuid", nullable: false),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_GameSaves", x => x.Id);
table.ForeignKey(
name: "FK_GameSaves_Games_GameId",
column: x => x.GameId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_GameSaves_StorageLocations_StorageLocationId",
column: x => x.StorageLocationId,
principalTable: "StorageLocations",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_GameSaves_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_GameSaves_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_GameSaves_Users_UserId",
column: x => x.UserId,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "GameTag",
columns: table => new
{
GamesId = table.Column<Guid>(type: "uuid", nullable: false),
TagsId = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_GameTag", x => new { x.GamesId, x.TagsId });
table.ForeignKey(
name: "FK_GameTag_Games_GamesId",
column: x => x.GamesId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_GameTag_Tags_TagsId",
column: x => x.TagsId,
principalTable: "Tags",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Issues",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Description = table.Column<string>(type: "text", nullable: false),
ResolvedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
GameId = table.Column<Guid>(type: "uuid", nullable: false),
ResolvedById = table.Column<Guid>(type: "uuid", nullable: true),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Issues", x => x.Id);
table.ForeignKey(
name: "FK_Issues_Games_GameId",
column: x => x.GameId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Issues_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Issues_Users_ResolvedById",
column: x => x.ResolvedById,
principalTable: "Users",
principalColumn: "Id");
table.ForeignKey(
name: "FK_Issues_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "Keys",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Value = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
GameId = table.Column<Guid>(type: "uuid", nullable: false),
AllocationMethod = table.Column<int>(type: "integer", nullable: false),
ClaimedByMacAddress = table.Column<string>(type: "character varying(17)", maxLength: 17, nullable: true),
ClaimedByIpv4Address = table.Column<string>(type: "character varying(15)", maxLength: 15, nullable: true),
ClaimedByComputerName = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
ClaimedByUserId = table.Column<Guid>(type: "uuid", nullable: true),
ClaimedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Keys", x => x.Id);
table.ForeignKey(
name: "FK_Keys_Games_GameId",
column: x => x.GameId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Keys_Users_ClaimedByUserId",
column: x => x.ClaimedByUserId,
principalTable: "Users",
principalColumn: "Id");
table.ForeignKey(
name: "FK_Keys_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Keys_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "LibraryGame",
columns: table => new
{
GameId = table.Column<Guid>(type: "uuid", nullable: false),
LibraryId = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_LibraryGame", x => new { x.GameId, x.LibraryId });
table.ForeignKey(
name: "FK_LibraryGame_Games_GameId",
column: x => x.GameId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_LibraryGame_Libraries_LibraryId",
column: x => x.LibraryId,
principalTable: "Libraries",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Media",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
FileId = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
Type = table.Column<int>(type: "integer", nullable: false),
SourceUrl = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
MimeType = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
Crc32 = table.Column<string>(type: "character varying(8)", maxLength: 8, nullable: false),
ThumbnailId = table.Column<Guid>(type: "uuid", nullable: true),
StorageLocationId = table.Column<Guid>(type: "uuid", nullable: false),
GameId = table.Column<Guid>(type: "uuid", nullable: true),
UserId = table.Column<Guid>(type: "uuid", nullable: true),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Media", x => x.Id);
table.ForeignKey(
name: "FK_Media_Games_GameId",
column: x => x.GameId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Media_Media_ThumbnailId",
column: x => x.ThumbnailId,
principalTable: "Media",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Media_StorageLocations_StorageLocationId",
column: x => x.StorageLocationId,
principalTable: "StorageLocations",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Media_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Media_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Media_Users_UserId",
column: x => x.UserId,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "MultiplayerModes",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Type = table.Column<int>(type: "integer", nullable: false),
NetworkProtocol = table.Column<int>(type: "integer", nullable: false),
Description = table.Column<string>(type: "text", nullable: true),
MinPlayers = table.Column<int>(type: "integer", nullable: false),
MaxPlayers = table.Column<int>(type: "integer", nullable: false),
Spectators = table.Column<int>(type: "integer", nullable: false),
GameId = table.Column<Guid>(type: "uuid", nullable: false),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_MultiplayerModes", x => x.Id);
table.ForeignKey(
name: "FK_MultiplayerModes_Games_GameId",
column: x => x.GameId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_MultiplayerModes_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_MultiplayerModes_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "PageGame",
columns: table => new
{
GameId = table.Column<Guid>(type: "uuid", nullable: false),
PageId = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PageGame", x => new { x.GameId, x.PageId });
table.ForeignKey(
name: "FK_PageGame_Games_GameId",
column: x => x.GameId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PageGame_Pages_PageId",
column: x => x.PageId,
principalTable: "Pages",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "PlaySessions",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
GameId = table.Column<Guid>(type: "uuid", nullable: true),
UserId = table.Column<Guid>(type: "uuid", nullable: false),
Start = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
End = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PlaySessions", x => x.Id);
table.ForeignKey(
name: "FK_PlaySessions_Games_GameId",
column: x => x.GameId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PlaySessions_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_PlaySessions_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_PlaySessions_Users_UserId",
column: x => x.UserId,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "SavePaths",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Type = table.Column<int>(type: "integer", nullable: false),
Path = table.Column<string>(type: "text", nullable: false),
WorkingDirectory = table.Column<string>(type: "text", nullable: true),
IsRegex = table.Column<bool>(type: "boolean", nullable: false),
GameId = table.Column<Guid>(type: "uuid", nullable: true),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_SavePaths", x => x.Id);
table.ForeignKey(
name: "FK_SavePaths_Games_GameId",
column: x => x.GameId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_SavePaths_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_SavePaths_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "Servers",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "text", nullable: false),
Path = table.Column<string>(type: "text", nullable: false),
Arguments = table.Column<string>(type: "text", nullable: false),
WorkingDirectory = table.Column<string>(type: "text", nullable: false),
OnStartScriptPath = table.Column<string>(type: "text", nullable: false),
OnStopScriptPath = table.Column<string>(type: "text", nullable: false),
Host = table.Column<string>(type: "text", nullable: false),
Port = table.Column<int>(type: "integer", nullable: false),
UseShellExecute = table.Column<bool>(type: "boolean", nullable: false),
ProcessTerminationMethod = table.Column<int>(type: "integer", nullable: false),
Autostart = table.Column<bool>(type: "boolean", nullable: false),
AutostartMethod = table.Column<int>(type: "integer", nullable: false),
AutostartDelay = table.Column<int>(type: "integer", nullable: false),
GameId = table.Column<Guid>(type: "uuid", nullable: true),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Servers", x => x.Id);
table.ForeignKey(
name: "FK_Servers_Games_GameId",
column: x => x.GameId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Servers_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Servers_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "Actions",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "text", nullable: false),
Arguments = table.Column<string>(type: "text", nullable: true),
Path = table.Column<string>(type: "text", nullable: true),
WorkingDirectory = table.Column<string>(type: "text", nullable: true),
PrimaryAction = table.Column<bool>(type: "boolean", nullable: false),
SortOrder = table.Column<int>(type: "integer", nullable: false),
GameId = table.Column<Guid>(type: "uuid", nullable: true),
ServerId = table.Column<Guid>(type: "uuid", nullable: true),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Actions", x => x.Id);
table.ForeignKey(
name: "FK_Actions_Games_GameId",
column: x => x.GameId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Actions_Servers_ServerId",
column: x => x.ServerId,
principalTable: "Servers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Actions_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Actions_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "PageServer",
columns: table => new
{
PageId = table.Column<Guid>(type: "uuid", nullable: false),
ServerId = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PageServer", x => new { x.PageId, x.ServerId });
table.ForeignKey(
name: "FK_PageServer_Pages_PageId",
column: x => x.PageId,
principalTable: "Pages",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PageServer_Servers_ServerId",
column: x => x.ServerId,
principalTable: "Servers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Scripts",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "text", nullable: false),
Description = table.Column<string>(type: "text", nullable: true),
Type = table.Column<int>(type: "integer", nullable: false),
Contents = table.Column<string>(type: "text", nullable: false),
RequiresAdmin = table.Column<bool>(type: "boolean", nullable: false),
GameId = table.Column<Guid>(type: "uuid", nullable: true),
RedistributableId = table.Column<Guid>(type: "uuid", nullable: true),
ServerId = table.Column<Guid>(type: "uuid", nullable: true),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Scripts", x => x.Id);
table.ForeignKey(
name: "FK_Scripts_Games_GameId",
column: x => x.GameId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Scripts_Redistributables_RedistributableId",
column: x => x.RedistributableId,
principalTable: "Redistributables",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Scripts_Servers_ServerId",
column: x => x.ServerId,
principalTable: "Servers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Scripts_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Scripts_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "ServerConsoles",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
Type = table.Column<int>(type: "integer", nullable: false),
Path = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
Host = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
Port = table.Column<int>(type: "integer", nullable: true),
Password = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
ServerId = table.Column<Guid>(type: "uuid", nullable: false),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ServerConsoles", x => x.Id);
table.ForeignKey(
name: "FK_ServerConsoles_Servers_ServerId",
column: x => x.ServerId,
principalTable: "Servers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ServerConsoles_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_ServerConsoles_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "ServerHttpPath",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
LocalPath = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
Path = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
ServerId = table.Column<Guid>(type: "uuid", nullable: false),
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatedById = table.Column<Guid>(type: "uuid", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedById = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ServerHttpPath", x => x.Id);
table.ForeignKey(
name: "FK_ServerHttpPath_Servers_ServerId",
column: x => x.ServerId,
principalTable: "Servers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ServerHttpPath_Users_CreatedById",
column: x => x.CreatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_ServerHttpPath_Users_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateIndex(
name: "IX_Actions_CreatedById",
table: "Actions",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Actions_GameId",
table: "Actions",
column: "GameId");
migrationBuilder.CreateIndex(
name: "IX_Actions_ServerId",
table: "Actions",
column: "ServerId");
migrationBuilder.CreateIndex(
name: "IX_Actions_UpdatedById",
table: "Actions",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_Archive_CreatedById",
table: "Archive",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Archive_GameId",
table: "Archive",
column: "GameId");
migrationBuilder.CreateIndex(
name: "IX_Archive_LastVersionId",
table: "Archive",
column: "LastVersionId");
migrationBuilder.CreateIndex(
name: "IX_Archive_RedistributableId",
table: "Archive",
column: "RedistributableId");
migrationBuilder.CreateIndex(
name: "IX_Archive_StorageLocationId",
table: "Archive",
column: "StorageLocationId");
migrationBuilder.CreateIndex(
name: "IX_Archive_UpdatedById",
table: "Archive",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_Categories_CreatedById",
table: "Categories",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Categories_ParentId",
table: "Categories",
column: "ParentId");
migrationBuilder.CreateIndex(
name: "IX_Categories_UpdatedById",
table: "Categories",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_CategoryGame_GamesId",
table: "CategoryGame",
column: "GamesId");
migrationBuilder.CreateIndex(
name: "IX_CollectionGame_GameId",
table: "CollectionGame",
column: "GameId");
migrationBuilder.CreateIndex(
name: "IX_Collections_CreatedById",
table: "Collections",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Collections_UpdatedById",
table: "Collections",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_Companies_CreatedById",
table: "Companies",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Companies_UpdatedById",
table: "Companies",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_Engines_CreatedById",
table: "Engines",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Engines_UpdatedById",
table: "Engines",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_GameCustomField_CreatedById",
table: "GameCustomField",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_GameCustomField_GameId",
table: "GameCustomField",
column: "GameId");
migrationBuilder.CreateIndex(
name: "IX_GameCustomField_UpdatedById",
table: "GameCustomField",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_GameDeveloper_DeveloperId",
table: "GameDeveloper",
column: "DeveloperId");
migrationBuilder.CreateIndex(
name: "IX_GameGenre_GenresId",
table: "GameGenre",
column: "GenresId");
migrationBuilder.CreateIndex(
name: "IX_GamePlatform_PlatformsId",
table: "GamePlatform",
column: "PlatformsId");
migrationBuilder.CreateIndex(
name: "IX_GamePublisher_PublisherId",
table: "GamePublisher",
column: "PublisherId");
migrationBuilder.CreateIndex(
name: "IX_GameRedistributable_RedistributableId",
table: "GameRedistributable",
column: "RedistributableId");
migrationBuilder.CreateIndex(
name: "IX_Games_BaseGameId",
table: "Games",
column: "BaseGameId");
migrationBuilder.CreateIndex(
name: "IX_Games_CreatedById",
table: "Games",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Games_EngineId",
table: "Games",
column: "EngineId");
migrationBuilder.CreateIndex(
name: "IX_Games_UpdatedById",
table: "Games",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_GameSaves_CreatedById",
table: "GameSaves",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_GameSaves_GameId",
table: "GameSaves",
column: "GameId");
migrationBuilder.CreateIndex(
name: "IX_GameSaves_StorageLocationId",
table: "GameSaves",
column: "StorageLocationId");
migrationBuilder.CreateIndex(
name: "IX_GameSaves_UpdatedById",
table: "GameSaves",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_GameSaves_UserId",
table: "GameSaves",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_GameTag_TagsId",
table: "GameTag",
column: "TagsId");
migrationBuilder.CreateIndex(
name: "IX_Genres_CreatedById",
table: "Genres",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Genres_UpdatedById",
table: "Genres",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_Issues_CreatedById",
table: "Issues",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Issues_GameId",
table: "Issues",
column: "GameId");
migrationBuilder.CreateIndex(
name: "IX_Issues_ResolvedById",
table: "Issues",
column: "ResolvedById");
migrationBuilder.CreateIndex(
name: "IX_Issues_UpdatedById",
table: "Issues",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_Keys_ClaimedByUserId",
table: "Keys",
column: "ClaimedByUserId");
migrationBuilder.CreateIndex(
name: "IX_Keys_CreatedById",
table: "Keys",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Keys_GameId",
table: "Keys",
column: "GameId");
migrationBuilder.CreateIndex(
name: "IX_Keys_UpdatedById",
table: "Keys",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_Libraries_CreatedById",
table: "Libraries",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Libraries_UpdatedById",
table: "Libraries",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_Libraries_UserId",
table: "Libraries",
column: "UserId",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_LibraryGame_LibraryId",
table: "LibraryGame",
column: "LibraryId");
migrationBuilder.CreateIndex(
name: "IX_Media_CreatedById",
table: "Media",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Media_GameId",
table: "Media",
column: "GameId");
migrationBuilder.CreateIndex(
name: "IX_Media_StorageLocationId",
table: "Media",
column: "StorageLocationId");
migrationBuilder.CreateIndex(
name: "IX_Media_ThumbnailId",
table: "Media",
column: "ThumbnailId",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Media_UpdatedById",
table: "Media",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_Media_UserId",
table: "Media",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_MultiplayerModes_CreatedById",
table: "MultiplayerModes",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_MultiplayerModes_GameId",
table: "MultiplayerModes",
column: "GameId");
migrationBuilder.CreateIndex(
name: "IX_MultiplayerModes_UpdatedById",
table: "MultiplayerModes",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_PageGame_PageId",
table: "PageGame",
column: "PageId");
migrationBuilder.CreateIndex(
name: "IX_PageRedistributable_RedistributableId",
table: "PageRedistributable",
column: "RedistributableId");
migrationBuilder.CreateIndex(
name: "IX_Pages_CreatedById",
table: "Pages",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Pages_ParentId",
table: "Pages",
column: "ParentId");
migrationBuilder.CreateIndex(
name: "IX_Pages_UpdatedById",
table: "Pages",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_PageServer_ServerId",
table: "PageServer",
column: "ServerId");
migrationBuilder.CreateIndex(
name: "IX_Platforms_CreatedById",
table: "Platforms",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Platforms_UpdatedById",
table: "Platforms",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_PlaySessions_CreatedById",
table: "PlaySessions",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_PlaySessions_GameId",
table: "PlaySessions",
column: "GameId");
migrationBuilder.CreateIndex(
name: "IX_PlaySessions_UpdatedById",
table: "PlaySessions",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_PlaySessions_UserId",
table: "PlaySessions",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_Redistributables_CreatedById",
table: "Redistributables",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Redistributables_UpdatedById",
table: "Redistributables",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_RoleClaims_RoleId",
table: "RoleClaims",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "IX_RoleCollection_RoleId",
table: "RoleCollection",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "IX_Roles_CreatedById",
table: "Roles",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Roles_UpdatedById",
table: "Roles",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "RoleNameIndex",
table: "Roles",
column: "NormalizedName",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_SavePaths_CreatedById",
table: "SavePaths",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_SavePaths_GameId",
table: "SavePaths",
column: "GameId");
migrationBuilder.CreateIndex(
name: "IX_SavePaths_UpdatedById",
table: "SavePaths",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_Scripts_CreatedById",
table: "Scripts",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Scripts_GameId",
table: "Scripts",
column: "GameId");
migrationBuilder.CreateIndex(
name: "IX_Scripts_RedistributableId",
table: "Scripts",
column: "RedistributableId");
migrationBuilder.CreateIndex(
name: "IX_Scripts_ServerId",
table: "Scripts",
column: "ServerId");
migrationBuilder.CreateIndex(
name: "IX_Scripts_UpdatedById",
table: "Scripts",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_ServerConsoles_CreatedById",
table: "ServerConsoles",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_ServerConsoles_ServerId",
table: "ServerConsoles",
column: "ServerId");
migrationBuilder.CreateIndex(
name: "IX_ServerConsoles_UpdatedById",
table: "ServerConsoles",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_ServerHttpPath_CreatedById",
table: "ServerHttpPath",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_ServerHttpPath_ServerId",
table: "ServerHttpPath",
column: "ServerId");
migrationBuilder.CreateIndex(
name: "IX_ServerHttpPath_UpdatedById",
table: "ServerHttpPath",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_Servers_CreatedById",
table: "Servers",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Servers_GameId",
table: "Servers",
column: "GameId");
migrationBuilder.CreateIndex(
name: "IX_Servers_UpdatedById",
table: "Servers",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_StorageLocations_CreatedById",
table: "StorageLocations",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_StorageLocations_UpdatedById",
table: "StorageLocations",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_Tags_CreatedById",
table: "Tags",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Tags_UpdatedById",
table: "Tags",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_UserClaims_UserId",
table: "UserClaims",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_UserCustomField_CreatedById",
table: "UserCustomField",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_UserCustomField_UpdatedById",
table: "UserCustomField",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_UserCustomField_UserId",
table: "UserCustomField",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_UserLogins_UserId",
table: "UserLogins",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_UserRoles_RoleId",
table: "UserRoles",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "EmailIndex",
table: "Users",
column: "NormalizedEmail");
migrationBuilder.CreateIndex(
name: "IX_Users_CreatedById",
table: "Users",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Users_UpdatedById",
table: "Users",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "UserNameIndex",
table: "Users",
column: "NormalizedUserName",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Actions");
migrationBuilder.DropTable(
name: "Archive");
migrationBuilder.DropTable(
name: "CategoryGame");
migrationBuilder.DropTable(
name: "CollectionGame");
migrationBuilder.DropTable(
name: "GameCustomField");
migrationBuilder.DropTable(
name: "GameDeveloper");
migrationBuilder.DropTable(
name: "GameGenre");
migrationBuilder.DropTable(
name: "GamePlatform");
migrationBuilder.DropTable(
name: "GamePublisher");
migrationBuilder.DropTable(
name: "GameRedistributable");
migrationBuilder.DropTable(
name: "GameSaves");
migrationBuilder.DropTable(
name: "GameTag");
migrationBuilder.DropTable(
name: "Issues");
migrationBuilder.DropTable(
name: "Keys");
migrationBuilder.DropTable(
name: "LibraryGame");
migrationBuilder.DropTable(
name: "Media");
migrationBuilder.DropTable(
name: "MultiplayerModes");
migrationBuilder.DropTable(
name: "PageGame");
migrationBuilder.DropTable(
name: "PageRedistributable");
migrationBuilder.DropTable(
name: "PageServer");
migrationBuilder.DropTable(
name: "PlaySessions");
migrationBuilder.DropTable(
name: "RoleClaims");
migrationBuilder.DropTable(
name: "RoleCollection");
migrationBuilder.DropTable(
name: "SavePaths");
migrationBuilder.DropTable(
name: "Scripts");
migrationBuilder.DropTable(
name: "ServerConsoles");
migrationBuilder.DropTable(
name: "ServerHttpPath");
migrationBuilder.DropTable(
name: "UserClaims");
migrationBuilder.DropTable(
name: "UserCustomField");
migrationBuilder.DropTable(
name: "UserLogins");
migrationBuilder.DropTable(
name: "UserRoles");
migrationBuilder.DropTable(
name: "UserTokens");
migrationBuilder.DropTable(
name: "Categories");
migrationBuilder.DropTable(
name: "Genres");
migrationBuilder.DropTable(
name: "Platforms");
migrationBuilder.DropTable(
name: "Companies");
migrationBuilder.DropTable(
name: "Tags");
migrationBuilder.DropTable(
name: "Libraries");
migrationBuilder.DropTable(
name: "StorageLocations");
migrationBuilder.DropTable(
name: "Pages");
migrationBuilder.DropTable(
name: "Collections");
migrationBuilder.DropTable(
name: "Redistributables");
migrationBuilder.DropTable(
name: "Servers");
migrationBuilder.DropTable(
name: "Roles");
migrationBuilder.DropTable(
name: "Games");
migrationBuilder.DropTable(
name: "Engines");
migrationBuilder.DropTable(
name: "Users");
}
}
}