Migration files
This commit is contained in:
+1002
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,743 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace OakArchive.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Init : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AspNetRoles",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
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_AspNetRoles", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Collections",
|
||||
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),
|
||||
CreatedBy = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
InviteCode = table.Column<string>(type: "text", nullable: false),
|
||||
IsPublic = table.Column<bool>(type: "boolean", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Collections", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Series",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
Logo = table.Column<string>(type: "text", nullable: true),
|
||||
Language = table.Column<int>(type: "integer", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Series", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AspNetRoleClaims",
|
||||
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_AspNetRoleClaims", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
|
||||
column: x => x.RoleId,
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AspNetUsers",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
DefaultCollectionId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
UserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||
NormalizedUserName = table.Column<string>(type: "character varying(256)", maxLength: 256, 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),
|
||||
PasswordHash = table.Column<string>(type: "text", nullable: true),
|
||||
SecurityStamp = table.Column<string>(type: "text", 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)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AspNetUsers", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_AspNetUsers_Collections_DefaultCollectionId",
|
||||
column: x => x.DefaultCollectionId,
|
||||
principalTable: "Collections",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Sets",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
Symbol = table.Column<string>(type: "text", nullable: true),
|
||||
Logo = table.Column<string>(type: "text", nullable: true),
|
||||
Language = table.Column<int>(type: "integer", nullable: false),
|
||||
ReleaseDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
||||
SerieId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Sets", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Sets_Series_SerieId",
|
||||
column: x => x.SerieId,
|
||||
principalTable: "Series",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "TcgDexSeriesInfos",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
SeriesId = table.Column<string>(type: "text", nullable: false),
|
||||
SeriesIdRef = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_TcgDexSeriesInfos", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_TcgDexSeriesInfos_Series_SeriesIdRef",
|
||||
column: x => x.SeriesIdRef,
|
||||
principalTable: "Series",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AspNetUserClaims",
|
||||
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_AspNetUserClaims", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_AspNetUserClaims_AspNetUsers_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AspNetUserLogins",
|
||||
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_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey });
|
||||
table.ForeignKey(
|
||||
name: "FK_AspNetUserLogins_AspNetUsers_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AspNetUserRoles",
|
||||
columns: table => new
|
||||
{
|
||||
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
RoleId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId });
|
||||
table.ForeignKey(
|
||||
name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
|
||||
column: x => x.RoleId,
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_AspNetUserRoles_AspNetUsers_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AspNetUserTokens",
|
||||
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_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
|
||||
table.ForeignKey(
|
||||
name: "FK_AspNetUserTokens_AspNetUsers_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Settings",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
AddCardsToDefaultList = table.Column<bool>(type: "boolean", nullable: false),
|
||||
UserId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Settings", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Settings_AspNetUsers_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "UserCollections",
|
||||
columns: table => new
|
||||
{
|
||||
CollectionsId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
MembersId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_UserCollections", x => new { x.CollectionsId, x.MembersId });
|
||||
table.ForeignKey(
|
||||
name: "FK_UserCollections_AspNetUsers_MembersId",
|
||||
column: x => x.MembersId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_UserCollections_Collections_CollectionsId",
|
||||
column: x => x.CollectionsId,
|
||||
principalTable: "Collections",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CardCounts",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Total = table.Column<int>(type: "integer", nullable: false),
|
||||
Official = table.Column<int>(type: "integer", nullable: false),
|
||||
Normal = table.Column<int>(type: "integer", nullable: false),
|
||||
Reverse = table.Column<int>(type: "integer", nullable: false),
|
||||
Holo = table.Column<int>(type: "integer", nullable: false),
|
||||
FirstEd = table.Column<int>(type: "integer", nullable: false),
|
||||
SetId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CardCounts", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_CardCounts_Sets_SetId",
|
||||
column: x => x.SetId,
|
||||
principalTable: "Sets",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CardMarketSetInfos",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ExpansionId = table.Column<string>(type: "text", nullable: false),
|
||||
SetId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CardMarketSetInfos", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_CardMarketSetInfos_Sets_SetId",
|
||||
column: x => x.SetId,
|
||||
principalTable: "Sets",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Cards",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
Image = table.Column<string>(type: "text", nullable: false),
|
||||
CardNumber = table.Column<int>(type: "integer", nullable: false),
|
||||
PHash = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
Hp = table.Column<int>(type: "integer", nullable: true),
|
||||
Retreat = table.Column<int>(type: "integer", nullable: true),
|
||||
TrainerType = table.Column<string>(type: "text", nullable: true),
|
||||
EnergyType = table.Column<string>(type: "text", nullable: true),
|
||||
Illustrator = table.Column<string>(type: "text", nullable: true),
|
||||
EvolveFrom = table.Column<string>(type: "text", nullable: true),
|
||||
Description = table.Column<string>(type: "text", nullable: true),
|
||||
RegulationMark = table.Column<string>(type: "text", nullable: true),
|
||||
Rarity = table.Column<int>(type: "integer", nullable: true),
|
||||
Category = table.Column<int>(type: "integer", nullable: true),
|
||||
Variants = table.Column<string>(type: "jsonb", nullable: true),
|
||||
Types = table.Column<string>(type: "jsonb", nullable: true),
|
||||
SetId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Cards", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Cards_Sets_SetId",
|
||||
column: x => x.SetId,
|
||||
principalTable: "Sets",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "TcgDexSetInfos",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
SetId = table.Column<string>(type: "text", nullable: false),
|
||||
SetIdRef = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_TcgDexSetInfos", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_TcgDexSetInfos_Sets_SetIdRef",
|
||||
column: x => x.SetIdRef,
|
||||
principalTable: "Sets",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Attacks",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Cost = table.Column<string>(type: "jsonb", nullable: false),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
Damage = table.Column<int>(type: "integer", nullable: true),
|
||||
Effect = table.Column<string>(type: "text", nullable: false),
|
||||
CardId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Attacks", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Attacks_Cards_CardId",
|
||||
column: x => x.CardId,
|
||||
principalTable: "Cards",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CollectedCards",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Variant = table.Column<int>(type: "integer", nullable: false),
|
||||
Condition = table.Column<int>(type: "integer", nullable: false),
|
||||
Count = table.Column<int>(type: "integer", nullable: false),
|
||||
Language = table.Column<int>(type: "integer", nullable: false),
|
||||
ScannedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
ScannedById = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
CollectionId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
CardId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CollectedCards", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_CollectedCards_AspNetUsers_ScannedById",
|
||||
column: x => x.ScannedById,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_CollectedCards_Cards_CardId",
|
||||
column: x => x.CardId,
|
||||
principalTable: "Cards",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_CollectedCards_Collections_CollectionId",
|
||||
column: x => x.CollectionId,
|
||||
principalTable: "Collections",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Legals",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Expanded = table.Column<bool>(type: "boolean", nullable: false),
|
||||
Standard = table.Column<bool>(type: "boolean", nullable: false),
|
||||
SetId = table.Column<Guid>(type: "uuid", nullable: true),
|
||||
CardId = table.Column<Guid>(type: "uuid", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Legals", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Legals_Cards_CardId",
|
||||
column: x => x.CardId,
|
||||
principalTable: "Cards",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_Legals_Sets_SetId",
|
||||
column: x => x.SetId,
|
||||
principalTable: "Sets",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "TcgDexCardInfos",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
FullId = table.Column<string>(type: "text", nullable: false),
|
||||
LocalId = table.Column<int>(type: "integer", nullable: false),
|
||||
CardId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_TcgDexCardInfos", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_TcgDexCardInfos_Cards_CardId",
|
||||
column: x => x.CardId,
|
||||
principalTable: "Cards",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Weaknesses",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Type = table.Column<string>(type: "text", nullable: false),
|
||||
Value = table.Column<string>(type: "text", nullable: false),
|
||||
CardId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Weaknesses", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Weaknesses_Cards_CardId",
|
||||
column: x => x.CardId,
|
||||
principalTable: "Cards",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Gradings",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Company = table.Column<int>(type: "integer", nullable: false),
|
||||
CertificateNumber = table.Column<string>(type: "text", nullable: false),
|
||||
Grade = table.Column<double>(type: "double precision", nullable: false),
|
||||
Centering = table.Column<double>(type: "double precision", nullable: true),
|
||||
Corners = table.Column<double>(type: "double precision", nullable: true),
|
||||
Edges = table.Column<double>(type: "double precision", nullable: true),
|
||||
Surface = table.Column<double>(type: "double precision", nullable: true),
|
||||
GraderNotes = table.Column<string>(type: "text", nullable: true),
|
||||
GradedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
CollectedCardId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Gradings", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Gradings_CollectedCards_CollectedCardId",
|
||||
column: x => x.CollectedCardId,
|
||||
principalTable: "CollectedCards",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AspNetRoleClaims_RoleId",
|
||||
table: "AspNetRoleClaims",
|
||||
column: "RoleId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "RoleNameIndex",
|
||||
table: "AspNetRoles",
|
||||
column: "NormalizedName",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AspNetUserClaims_UserId",
|
||||
table: "AspNetUserClaims",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AspNetUserLogins_UserId",
|
||||
table: "AspNetUserLogins",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AspNetUserRoles_RoleId",
|
||||
table: "AspNetUserRoles",
|
||||
column: "RoleId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "EmailIndex",
|
||||
table: "AspNetUsers",
|
||||
column: "NormalizedEmail");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AspNetUsers_DefaultCollectionId",
|
||||
table: "AspNetUsers",
|
||||
column: "DefaultCollectionId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "UserNameIndex",
|
||||
table: "AspNetUsers",
|
||||
column: "NormalizedUserName",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Attacks_CardId",
|
||||
table: "Attacks",
|
||||
column: "CardId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CardCounts_SetId",
|
||||
table: "CardCounts",
|
||||
column: "SetId",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CardMarketSetInfos_SetId",
|
||||
table: "CardMarketSetInfos",
|
||||
column: "SetId",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Cards_SetId",
|
||||
table: "Cards",
|
||||
column: "SetId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CollectedCards_CardId",
|
||||
table: "CollectedCards",
|
||||
column: "CardId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CollectedCards_CollectionId",
|
||||
table: "CollectedCards",
|
||||
column: "CollectionId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CollectedCards_ScannedById",
|
||||
table: "CollectedCards",
|
||||
column: "ScannedById");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Gradings_CollectedCardId",
|
||||
table: "Gradings",
|
||||
column: "CollectedCardId",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Legals_CardId",
|
||||
table: "Legals",
|
||||
column: "CardId",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Legals_SetId",
|
||||
table: "Legals",
|
||||
column: "SetId",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Sets_SerieId",
|
||||
table: "Sets",
|
||||
column: "SerieId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Settings_UserId",
|
||||
table: "Settings",
|
||||
column: "UserId",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TcgDexCardInfos_CardId",
|
||||
table: "TcgDexCardInfos",
|
||||
column: "CardId",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TcgDexSeriesInfos_SeriesIdRef",
|
||||
table: "TcgDexSeriesInfos",
|
||||
column: "SeriesIdRef",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TcgDexSetInfos_SetIdRef",
|
||||
table: "TcgDexSetInfos",
|
||||
column: "SetIdRef",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_UserCollections_MembersId",
|
||||
table: "UserCollections",
|
||||
column: "MembersId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Weaknesses_CardId",
|
||||
table: "Weaknesses",
|
||||
column: "CardId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "AspNetRoleClaims");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AspNetUserClaims");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AspNetUserLogins");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AspNetUserRoles");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AspNetUserTokens");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Attacks");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "CardCounts");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "CardMarketSetInfos");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Gradings");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Legals");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Settings");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "TcgDexCardInfos");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "TcgDexSeriesInfos");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "TcgDexSetInfos");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "UserCollections");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Weaknesses");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AspNetRoles");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "CollectedCards");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AspNetUsers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Cards");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Collections");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Sets");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Series");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,999 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
using OakArchive.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace OakArchive.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationDbContext))]
|
||||
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "10.0.7")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("ApplicationUserCollection", b =>
|
||||
{
|
||||
b.Property<Guid>("CollectionsId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("MembersId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("CollectionsId", "MembersId");
|
||||
|
||||
b.HasIndex("MembersId");
|
||||
|
||||
b.ToTable("UserCollections", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole<System.Guid>", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("RoleNameIndex");
|
||||
|
||||
b.ToTable("AspNetRoles", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("RoleId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetRoleClaims", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserClaims", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ProviderKey")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ProviderDisplayName")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserLogins", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||
{
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("RoleId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetUserRoles", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||
{
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("UserId", "LoginProvider", "Name");
|
||||
|
||||
b.ToTable("AspNetUserTokens", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.CardMarket.CardMarketSetInfo", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ExpansionId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("SetId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SetId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("CardMarketSetInfos");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Cards.Attack", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("CardId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.PrimitiveCollection<string>("Cost")
|
||||
.IsRequired()
|
||||
.HasColumnType("jsonb");
|
||||
|
||||
b.Property<int?>("Damage")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Effect")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CardId");
|
||||
|
||||
b.ToTable("Attacks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Cards.Card", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("CardNumber")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("Category")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("EnergyType")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("EvolveFrom")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int?>("Hp")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Illustrator")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Image")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<decimal>("PHash")
|
||||
.HasColumnType("numeric(20,0)");
|
||||
|
||||
b.Property<int?>("Rarity")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("RegulationMark")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int?>("Retreat")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<Guid>("SetId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("TrainerType")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.PrimitiveCollection<string>("Types")
|
||||
.HasColumnType("jsonb");
|
||||
|
||||
b.PrimitiveCollection<string>("Variants")
|
||||
.HasColumnType("jsonb");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SetId");
|
||||
|
||||
b.ToTable("Cards");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Cards.CollectedCard", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("CardId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("CollectionId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("Condition")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Count")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Language")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("ScannedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<Guid>("ScannedById")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("Variant")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CardId");
|
||||
|
||||
b.HasIndex("CollectionId");
|
||||
|
||||
b.HasIndex("ScannedById");
|
||||
|
||||
b.ToTable("CollectedCards");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Cards.Weakness", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("CardId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CardId");
|
||||
|
||||
b.ToTable("Weaknesses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Collection.Collection", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<Guid>("CreatedBy")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("InviteCode")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsPublic")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Collections");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Grading.Grading", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<double?>("Centering")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<string>("CertificateNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("CollectedCardId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("Company")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<double?>("Corners")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<double?>("Edges")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<double>("Grade")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<DateTime>("GradedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("GraderNotes")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<double?>("Surface")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CollectedCardId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Gradings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Serie.Serie", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int?>("Language")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Logo")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Series");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Set.CardCount", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("FirstEd")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Holo")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Normal")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Official")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Reverse")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<Guid>("SetId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("Total")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SetId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("CardCounts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Set.Legal", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid?>("CardId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<bool>("Expanded")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid?>("SetId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<bool>("Standard")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CardId")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("SetId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Legals");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Set.Set", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("Language")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Logo")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime?>("ReleaseDate")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<Guid>("SerieId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Symbol")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SerieId");
|
||||
|
||||
b.ToTable("Sets");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.TCGdex.TcgDexCardInfo", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("CardId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("FullId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("LocalId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CardId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("TcgDexCardInfos");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.TCGdex.TcgDexSeriesInfo", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("SeriesId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("SeriesIdRef")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SeriesIdRef")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("TcgDexSeriesInfos");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.TCGdex.TcgDexSetInfo", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("SetId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("SetIdRef")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SetIdRef")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("TcgDexSetInfos");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.User.ApplicationUser", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("AccessFailedCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<Guid>("DefaultCollectionId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("LockoutEnabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("SecurityStamp")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DefaultCollectionId");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasDatabaseName("EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("UserNameIndex");
|
||||
|
||||
b.ToTable("AspNetUsers", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.User.Settings", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<bool>("AddCardsToDefaultList")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Settings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ApplicationUserCollection", b =>
|
||||
{
|
||||
b.HasOne("OakArchive.Entities.Collection.Collection", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("CollectionsId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("OakArchive.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("MembersId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole<System.Guid>", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("OakArchive.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("OakArchive.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole<System.Guid>", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("OakArchive.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("OakArchive.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.CardMarket.CardMarketSetInfo", b =>
|
||||
{
|
||||
b.HasOne("OakArchive.Entities.Set.Set", "Set")
|
||||
.WithOne("CardMarketSetInfo")
|
||||
.HasForeignKey("OakArchive.Entities.CardMarket.CardMarketSetInfo", "SetId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Set");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Cards.Attack", b =>
|
||||
{
|
||||
b.HasOne("OakArchive.Entities.Cards.Card", "Card")
|
||||
.WithMany("Attacks")
|
||||
.HasForeignKey("CardId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Card");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Cards.Card", b =>
|
||||
{
|
||||
b.HasOne("OakArchive.Entities.Set.Set", "Set")
|
||||
.WithMany("Cards")
|
||||
.HasForeignKey("SetId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Set");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Cards.CollectedCard", b =>
|
||||
{
|
||||
b.HasOne("OakArchive.Entities.Cards.Card", "Card")
|
||||
.WithMany()
|
||||
.HasForeignKey("CardId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("OakArchive.Entities.Collection.Collection", "Collection")
|
||||
.WithMany("Cards")
|
||||
.HasForeignKey("CollectionId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("OakArchive.Entities.User.ApplicationUser", "ScannedBy")
|
||||
.WithMany()
|
||||
.HasForeignKey("ScannedById")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Card");
|
||||
|
||||
b.Navigation("Collection");
|
||||
|
||||
b.Navigation("ScannedBy");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Cards.Weakness", b =>
|
||||
{
|
||||
b.HasOne("OakArchive.Entities.Cards.Card", "Card")
|
||||
.WithMany("Weaknesses")
|
||||
.HasForeignKey("CardId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Card");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Grading.Grading", b =>
|
||||
{
|
||||
b.HasOne("OakArchive.Entities.Cards.CollectedCard", "CollectedCard")
|
||||
.WithOne("Grading")
|
||||
.HasForeignKey("OakArchive.Entities.Grading.Grading", "CollectedCardId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("CollectedCard");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Set.CardCount", b =>
|
||||
{
|
||||
b.HasOne("OakArchive.Entities.Set.Set", "Set")
|
||||
.WithOne("CardCount")
|
||||
.HasForeignKey("OakArchive.Entities.Set.CardCount", "SetId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Set");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Set.Legal", b =>
|
||||
{
|
||||
b.HasOne("OakArchive.Entities.Cards.Card", "Card")
|
||||
.WithOne("Legal")
|
||||
.HasForeignKey("OakArchive.Entities.Set.Legal", "CardId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("OakArchive.Entities.Set.Set", "Set")
|
||||
.WithOne("Legal")
|
||||
.HasForeignKey("OakArchive.Entities.Set.Legal", "SetId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.Navigation("Card");
|
||||
|
||||
b.Navigation("Set");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Set.Set", b =>
|
||||
{
|
||||
b.HasOne("OakArchive.Entities.Serie.Serie", "Serie")
|
||||
.WithMany("Sets")
|
||||
.HasForeignKey("SerieId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Serie");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.TCGdex.TcgDexCardInfo", b =>
|
||||
{
|
||||
b.HasOne("OakArchive.Entities.Cards.Card", "Card")
|
||||
.WithOne("TcgDexCardInfo")
|
||||
.HasForeignKey("OakArchive.Entities.TCGdex.TcgDexCardInfo", "CardId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Card");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.TCGdex.TcgDexSeriesInfo", b =>
|
||||
{
|
||||
b.HasOne("OakArchive.Entities.Serie.Serie", "Series")
|
||||
.WithOne("TcgDexSeriesInfo")
|
||||
.HasForeignKey("OakArchive.Entities.TCGdex.TcgDexSeriesInfo", "SeriesIdRef")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Series");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.TCGdex.TcgDexSetInfo", b =>
|
||||
{
|
||||
b.HasOne("OakArchive.Entities.Set.Set", "Set")
|
||||
.WithOne("SetInfo")
|
||||
.HasForeignKey("OakArchive.Entities.TCGdex.TcgDexSetInfo", "SetIdRef")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Set");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.User.ApplicationUser", b =>
|
||||
{
|
||||
b.HasOne("OakArchive.Entities.Collection.Collection", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("DefaultCollectionId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.User.Settings", b =>
|
||||
{
|
||||
b.HasOne("OakArchive.Entities.User.ApplicationUser", "User")
|
||||
.WithOne("Settings")
|
||||
.HasForeignKey("OakArchive.Entities.User.Settings", "UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Cards.Card", b =>
|
||||
{
|
||||
b.Navigation("Attacks");
|
||||
|
||||
b.Navigation("Legal");
|
||||
|
||||
b.Navigation("TcgDexCardInfo")
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Weaknesses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Cards.CollectedCard", b =>
|
||||
{
|
||||
b.Navigation("Grading");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Collection.Collection", b =>
|
||||
{
|
||||
b.Navigation("Cards");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Serie.Serie", b =>
|
||||
{
|
||||
b.Navigation("Sets");
|
||||
|
||||
b.Navigation("TcgDexSeriesInfo")
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.Set.Set", b =>
|
||||
{
|
||||
b.Navigation("CardCount")
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("CardMarketSetInfo")
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Cards");
|
||||
|
||||
b.Navigation("Legal");
|
||||
|
||||
b.Navigation("SetInfo")
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("OakArchive.Entities.User.ApplicationUser", b =>
|
||||
{
|
||||
b.Navigation("Settings")
|
||||
.IsRequired();
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user