diff options
Initial Commit - Add all project files
11 files changed, 3153 insertions, 0 deletions
diff --git a/src/Data/PCC.Data/Migrations/20201213103408_Initial.Designer.cs b/src/Data/PCC.Data/Migrations/20201213103408_Initial.Designer.cs new file mode 100644 index 0000000..6261cbf --- /dev/null +++ b/src/Data/PCC.Data/Migrations/20201213103408_Initial.Designer.cs @@ -0,0 +1,277 @@ +// <auto-generated /> +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using PCC.Data; + +namespace PCC.Data.Migrations +{ + [DbContext(typeof(PCCDbContext))] + [Migration("20201213103408_Initial")] + partial class Initial + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.10") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Name") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property<string>("NormalizedName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => + { + b.Property<int>("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property<string>("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("RoleId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => + { + b.Property<int>("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property<string>("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => + { + b.Property<string>("LoginProvider") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property<string>("ProviderKey") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property<string>("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => + { + b.Property<string>("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("RoleId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => + { + b.Property<string>("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("LoginProvider") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property<string>("Name") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property<string>("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens"); + }); + + modelBuilder.Entity("PCC.Data.Models.PCCUser", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<int>("AccessFailedCount") + .HasColumnType("int"); + + b.Property<string>("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Email") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property<bool>("EmailConfirmed") + .HasColumnType("bit"); + + b.Property<bool>("LockoutEnabled") + .HasColumnType("bit"); + + b.Property<DateTimeOffset?>("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property<string>("NormalizedEmail") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property<string>("NormalizedUserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property<string>("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property<bool>("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property<string>("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property<bool>("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property<string>("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("AspNetUsers"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => + { + b.HasOne("PCC.Data.Models.PCCUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => + { + b.HasOne("PCC.Data.Models.PCCUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PCC.Data.Models.PCCUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => + { + b.HasOne("PCC.Data.Models.PCCUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Data/PCC.Data/Migrations/20201213103408_Initial.cs b/src/Data/PCC.Data/Migrations/20201213103408_Initial.cs new file mode 100644 index 0000000..f97b590 --- /dev/null +++ b/src/Data/PCC.Data/Migrations/20201213103408_Initial.cs @@ -0,0 +1,219 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace PCC.Data.Migrations +{ + public partial class Initial : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "AspNetRoles", + columns: table => new + { + Id = table.Column<string>(nullable: false), + Name = table.Column<string>(maxLength: 256, nullable: true), + NormalizedName = table.Column<string>(maxLength: 256, nullable: true), + ConcurrencyStamp = table.Column<string>(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetRoles", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AspNetUsers", + columns: table => new + { + Id = table.Column<string>(nullable: false), + UserName = table.Column<string>(maxLength: 256, nullable: true), + NormalizedUserName = table.Column<string>(maxLength: 256, nullable: true), + Email = table.Column<string>(maxLength: 256, nullable: true), + NormalizedEmail = table.Column<string>(maxLength: 256, nullable: true), + EmailConfirmed = table.Column<bool>(nullable: false), + PasswordHash = table.Column<string>(nullable: true), + SecurityStamp = table.Column<string>(nullable: true), + ConcurrencyStamp = table.Column<string>(nullable: true), + PhoneNumber = table.Column<string>(nullable: true), + PhoneNumberConfirmed = table.Column<bool>(nullable: false), + TwoFactorEnabled = table.Column<bool>(nullable: false), + LockoutEnd = table.Column<DateTimeOffset>(nullable: true), + LockoutEnabled = table.Column<bool>(nullable: false), + AccessFailedCount = table.Column<int>(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetUsers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AspNetRoleClaims", + columns: table => new + { + Id = table.Column<int>(nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + RoleId = table.Column<string>(nullable: false), + ClaimType = table.Column<string>(nullable: true), + ClaimValue = table.Column<string>(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: "AspNetUserClaims", + columns: table => new + { + Id = table.Column<int>(nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + UserId = table.Column<string>(nullable: false), + ClaimType = table.Column<string>(nullable: true), + ClaimValue = table.Column<string>(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>(maxLength: 128, nullable: false), + ProviderKey = table.Column<string>(maxLength: 128, nullable: false), + ProviderDisplayName = table.Column<string>(nullable: true), + UserId = table.Column<string>(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<string>(nullable: false), + RoleId = table.Column<string>(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<string>(nullable: false), + LoginProvider = table.Column<string>(maxLength: 128, nullable: false), + Name = table.Column<string>(maxLength: 128, nullable: false), + Value = table.Column<string>(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.CreateIndex( + name: "IX_AspNetRoleClaims_RoleId", + table: "AspNetRoleClaims", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "RoleNameIndex", + table: "AspNetRoles", + column: "NormalizedName", + unique: true, + filter: "[NormalizedName] IS NOT NULL"); + + 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: "UserNameIndex", + table: "AspNetUsers", + column: "NormalizedUserName", + unique: true, + filter: "[NormalizedUserName] IS NOT NULL"); + } + + 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: "AspNetRoles"); + + migrationBuilder.DropTable( + name: "AspNetUsers"); + } + } +} diff --git a/src/Data/PCC.Data/Migrations/20201219095311_Initialized-PC-Parts.Designer.cs b/src/Data/PCC.Data/Migrations/20201219095311_Initialized-PC-Parts.Designer.cs new file mode 100644 index 0000000..f963406 --- /dev/null +++ b/src/Data/PCC.Data/Migrations/20201219095311_Initialized-PC-Parts.Designer.cs @@ -0,0 +1,556 @@ +// <auto-generated /> +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using PCC.Data; + +namespace PCC.Data.Migrations +{ + [DbContext(typeof(PCCDbContext))] + [Migration("20201219095311_Initialized-PC-Parts")] + partial class InitializedPCParts + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.10") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Name") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property<string>("NormalizedName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => + { + b.Property<int>("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property<string>("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("RoleId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => + { + b.Property<int>("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property<string>("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => + { + b.Property<string>("LoginProvider") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property<string>("ProviderKey") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property<string>("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => + { + b.Property<string>("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("RoleId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => + { + b.Property<string>("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("LoginProvider") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property<string>("Name") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property<string>("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens"); + }); + + modelBuilder.Entity("PCC.Data.Models.PCCUser", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<int>("AccessFailedCount") + .HasColumnType("int"); + + b.Property<string>("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Email") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property<bool>("EmailConfirmed") + .HasColumnType("bit"); + + b.Property<bool>("LockoutEnabled") + .HasColumnType("bit"); + + b.Property<DateTimeOffset?>("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property<string>("NormalizedEmail") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property<string>("NormalizedUserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property<string>("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property<bool>("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property<string>("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property<bool>("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property<string>("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("AspNetUsers"); + }); + + modelBuilder.Entity("PCC.Data.Models.ParameterSettings", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<long>("RecommendedProcessorClockspeed") + .HasColumnType("bigint"); + + b.Property<long>("RecommendedProcessorCores") + .HasColumnType("bigint"); + + b.Property<string>("RecommendedProcessorGeneration") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("RecommendedRAM") + .HasColumnType("bigint"); + + b.Property<long>("RecommendedRAMSpeed") + .HasColumnType("bigint"); + + b.Property<string>("RecommendedRAMType") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("RecommendedStorageSpace") + .HasColumnType("bigint"); + + b.Property<long>("RecommendedVideoClockspeed") + .HasColumnType("bigint"); + + b.Property<string>("RecommendedVideoGeneration") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("RecommendedVideoMemory") + .HasColumnType("bigint"); + + b.Property<string>("SettingId") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("SoftwareId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("SettingId"); + + b.HasIndex("SoftwareId"); + + b.ToTable("ParameterSettings"); + }); + + modelBuilder.Entity("PCC.Data.Models.Parts.GPU", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("Clockspeed") + .HasColumnType("bigint"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("Generation") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("Memory") + .HasColumnType("bigint"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.ToTable("GPUs"); + }); + + modelBuilder.Entity("PCC.Data.Models.Parts.HardDisk", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("Capacity") + .HasColumnType("bigint"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<bool>("IsSSD") + .HasColumnType("bit"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.Property<long>("Speed") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.ToTable("HardDisks"); + }); + + modelBuilder.Entity("PCC.Data.Models.Parts.Motherboard", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("CPUSupport") + .HasColumnType("nvarchar(max)"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("MemorySupport") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.ToTable("Motherboards"); + }); + + modelBuilder.Entity("PCC.Data.Models.Parts.PowerSupply", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.Property<int>("SupportedElectricalPowerConsumption") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("PowerSupplies"); + }); + + modelBuilder.Entity("PCC.Data.Models.Parts.RAM", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("Capacity") + .HasColumnType("bigint"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.Property<long>("Speed") + .HasColumnType("bigint"); + + b.Property<string>("Type") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("RAMs"); + }); + + modelBuilder.Entity("PCC.Data.Models.Processor", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("Clockspeed") + .HasColumnType("bigint"); + + b.Property<int>("Cores") + .HasColumnType("int"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("Generation") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.ToTable("Processors"); + }); + + modelBuilder.Entity("PCC.Data.Models.Setting", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<bool>("IsGame") + .HasColumnType("bit"); + + b.Property<string>("Name") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Settings"); + }); + + modelBuilder.Entity("PCC.Data.Models.Software", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Description") + .HasColumnType("nvarchar(max)"); + + b.Property<bool>("IsGame") + .HasColumnType("bit"); + + b.Property<string>("ParamatersId") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Title") + .HasColumnType("nvarchar(max)"); + + b.Property<int>("Year") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Softwares"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => + { + b.HasOne("PCC.Data.Models.PCCUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => + { + b.HasOne("PCC.Data.Models.PCCUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PCC.Data.Models.PCCUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => + { + b.HasOne("PCC.Data.Models.PCCUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("PCC.Data.Models.ParameterSettings", b => + { + b.HasOne("PCC.Data.Models.Setting", "Setting") + .WithMany() + .HasForeignKey("SettingId"); + + b.HasOne("PCC.Data.Models.Software", "Software") + .WithMany("ParametersPerSetting") + .HasForeignKey("SoftwareId"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Data/PCC.Data/Migrations/20201219095311_Initialized-PC-Parts.cs b/src/Data/PCC.Data/Migrations/20201219095311_Initialized-PC-Parts.cs new file mode 100644 index 0000000..fd2e5ad --- /dev/null +++ b/src/Data/PCC.Data/Migrations/20201219095311_Initialized-PC-Parts.cs @@ -0,0 +1,219 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace PCC.Data.Migrations +{ + public partial class InitializedPCParts : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "GPUs", + columns: table => new + { + Id = table.Column<string>(nullable: false), + Brand = table.Column<string>(nullable: true), + Model = table.Column<string>(nullable: true), + Price = table.Column<decimal>(nullable: false), + ElectricalPowerConsumption = table.Column<int>(nullable: false), + Memory = table.Column<long>(nullable: false), + Clockspeed = table.Column<long>(nullable: false), + Generation = table.Column<string>(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_GPUs", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "HardDisks", + columns: table => new + { + Id = table.Column<string>(nullable: false), + Brand = table.Column<string>(nullable: true), + Model = table.Column<string>(nullable: true), + Price = table.Column<decimal>(nullable: false), + ElectricalPowerConsumption = table.Column<int>(nullable: false), + Capacity = table.Column<long>(nullable: false), + Speed = table.Column<long>(nullable: false), + IsSSD = table.Column<bool>(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_HardDisks", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Motherboards", + columns: table => new + { + Id = table.Column<string>(nullable: false), + Brand = table.Column<string>(nullable: true), + Model = table.Column<string>(nullable: true), + Price = table.Column<decimal>(nullable: false), + ElectricalPowerConsumption = table.Column<int>(nullable: false), + CPUSupport = table.Column<string>(nullable: true), + MemorySupport = table.Column<string>(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Motherboards", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "PowerSupplies", + columns: table => new + { + Id = table.Column<string>(nullable: false), + Brand = table.Column<string>(nullable: true), + Model = table.Column<string>(nullable: true), + Price = table.Column<decimal>(nullable: false), + ElectricalPowerConsumption = table.Column<int>(nullable: false), + SupportedElectricalPowerConsumption = table.Column<int>(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_PowerSupplies", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Processors", + columns: table => new + { + Id = table.Column<string>(nullable: false), + Brand = table.Column<string>(nullable: true), + Model = table.Column<string>(nullable: true), + Price = table.Column<decimal>(nullable: false), + ElectricalPowerConsumption = table.Column<int>(nullable: false), + Cores = table.Column<int>(nullable: false), + Clockspeed = table.Column<long>(nullable: false), + Generation = table.Column<string>(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Processors", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "RAMs", + columns: table => new + { + Id = table.Column<string>(nullable: false), + Brand = table.Column<string>(nullable: true), + Model = table.Column<string>(nullable: true), + Price = table.Column<decimal>(nullable: false), + ElectricalPowerConsumption = table.Column<int>(nullable: false), + Capacity = table.Column<long>(nullable: false), + Type = table.Column<string>(nullable: true), + Speed = table.Column<long>(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_RAMs", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Settings", + columns: table => new + { + Id = table.Column<string>(nullable: false), + Name = table.Column<string>(nullable: true), + IsGame = table.Column<bool>(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Settings", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Softwares", + columns: table => new + { + Id = table.Column<string>(nullable: false), + Title = table.Column<string>(nullable: true), + Year = table.Column<int>(nullable: false), + Description = table.Column<string>(nullable: true), + IsGame = table.Column<bool>(nullable: false), + ParamatersId = table.Column<string>(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Softwares", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "ParameterSettings", + columns: table => new + { + Id = table.Column<string>(nullable: false), + RecommendedRAM = table.Column<long>(nullable: false), + RecommendedRAMType = table.Column<string>(nullable: true), + RecommendedRAMSpeed = table.Column<long>(nullable: false), + RecommendedProcessorClockspeed = table.Column<long>(nullable: false), + RecommendedProcessorCores = table.Column<long>(nullable: false), + RecommendedProcessorGeneration = table.Column<string>(nullable: true), + RecommendedStorageSpace = table.Column<long>(nullable: false), + RecommendedVideoMemory = table.Column<long>(nullable: false), + RecommendedVideoClockspeed = table.Column<long>(nullable: false), + RecommendedVideoGeneration = table.Column<string>(nullable: true), + SettingId = table.Column<string>(nullable: true), + SoftwareId = table.Column<string>(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_ParameterSettings", x => x.Id); + table.ForeignKey( + name: "FK_ParameterSettings_Settings_SettingId", + column: x => x.SettingId, + principalTable: "Settings", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_ParameterSettings_Softwares_SoftwareId", + column: x => x.SoftwareId, + principalTable: "Softwares", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateIndex( + name: "IX_ParameterSettings_SettingId", + table: "ParameterSettings", + column: "SettingId"); + + migrationBuilder.CreateIndex( + name: "IX_ParameterSettings_SoftwareId", + table: "ParameterSettings", + column: "SoftwareId"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "GPUs"); + + migrationBuilder.DropTable( + name: "HardDisks"); + + migrationBuilder.DropTable( + name: "Motherboards"); + + migrationBuilder.DropTable( + name: "ParameterSettings"); + + migrationBuilder.DropTable( + name: "PowerSupplies"); + + migrationBuilder.DropTable( + name: "Processors"); + + migrationBuilder.DropTable( + name: "RAMs"); + + migrationBuilder.DropTable( + name: "Settings"); + + migrationBuilder.DropTable( + name: "Softwares"); + } + } +} diff --git a/src/Data/PCC.Data/Migrations/20210116105035_Secondary.Designer.cs b/src/Data/PCC.Data/Migrations/20210116105035_Secondary.Designer.cs new file mode 100644 index 0000000..0871e2c --- /dev/null +++ b/src/Data/PCC.Data/Migrations/20210116105035_Secondary.Designer.cs @@ -0,0 +1,574 @@ +// <auto-generated /> +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using PCC.Data; + +namespace PCC.Data.Migrations +{ + [DbContext(typeof(PCCDbContext))] + [Migration("20210116105035_Secondary")] + partial class Secondary + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.10") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Name") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property<string>("NormalizedName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => + { + b.Property<int>("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property<string>("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("RoleId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => + { + b.Property<int>("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property<string>("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => + { + b.Property<string>("LoginProvider") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property<string>("ProviderKey") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property<string>("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => + { + b.Property<string>("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("RoleId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => + { + b.Property<string>("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("LoginProvider") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property<string>("Name") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property<string>("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens"); + }); + + modelBuilder.Entity("PCC.Data.Models.PCCUser", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<int>("AccessFailedCount") + .HasColumnType("int"); + + b.Property<string>("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Email") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property<bool>("EmailConfirmed") + .HasColumnType("bit"); + + b.Property<bool>("LockoutEnabled") + .HasColumnType("bit"); + + b.Property<DateTimeOffset?>("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property<string>("NormalizedEmail") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property<string>("NormalizedUserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property<string>("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property<bool>("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property<string>("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property<bool>("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property<string>("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("AspNetUsers"); + }); + + modelBuilder.Entity("PCC.Data.Models.ParameterSettings", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<long>("RecommendedProcessorClockspeed") + .HasColumnType("bigint"); + + b.Property<long>("RecommendedProcessorCores") + .HasColumnType("bigint"); + + b.Property<string>("RecommendedProcessorGeneration") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("RecommendedRAM") + .HasColumnType("bigint"); + + b.Property<long>("RecommendedRAMSpeed") + .HasColumnType("bigint"); + + b.Property<string>("RecommendedRAMType") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("RecommendedStorageSpace") + .HasColumnType("bigint"); + + b.Property<long>("RecommendedVideoClockspeed") + .HasColumnType("bigint"); + + b.Property<string>("RecommendedVideoGeneration") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("RecommendedVideoMemory") + .HasColumnType("bigint"); + + b.Property<string>("SettingId") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("SoftwareId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("SettingId"); + + b.HasIndex("SoftwareId"); + + b.ToTable("ParameterSettings"); + }); + + modelBuilder.Entity("PCC.Data.Models.Parts.GPU", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("Clockspeed") + .HasColumnType("bigint"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("Generation") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("ImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("Memory") + .HasColumnType("bigint"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.ToTable("GPUs"); + }); + + modelBuilder.Entity("PCC.Data.Models.Parts.HardDisk", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("Capacity") + .HasColumnType("bigint"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("ImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property<bool>("IsSSD") + .HasColumnType("bit"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.Property<long>("Speed") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.ToTable("HardDisks"); + }); + + modelBuilder.Entity("PCC.Data.Models.Parts.Motherboard", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("CPUSupport") + .HasColumnType("nvarchar(max)"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("ImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("MemorySupport") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.ToTable("Motherboards"); + }); + + modelBuilder.Entity("PCC.Data.Models.Parts.PowerSupply", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("ImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.Property<int>("SupportedElectricalPowerConsumption") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("PowerSupplies"); + }); + + modelBuilder.Entity("PCC.Data.Models.Parts.RAM", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("Capacity") + .HasColumnType("bigint"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("ImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.Property<long>("Speed") + .HasColumnType("bigint"); + + b.Property<string>("Type") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("RAMs"); + }); + + modelBuilder.Entity("PCC.Data.Models.Processor", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("Clockspeed") + .HasColumnType("bigint"); + + b.Property<int>("Cores") + .HasColumnType("int"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("Generation") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("ImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.ToTable("Processors"); + }); + + modelBuilder.Entity("PCC.Data.Models.Setting", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<bool>("IsGame") + .HasColumnType("bit"); + + b.Property<string>("Name") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Settings"); + }); + + modelBuilder.Entity("PCC.Data.Models.Software", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Description") + .HasColumnType("nvarchar(max)"); + + b.Property<bool>("IsGame") + .HasColumnType("bit"); + + b.Property<string>("ParamatersId") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Title") + .HasColumnType("nvarchar(max)"); + + b.Property<int>("Year") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Softwares"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => + { + b.HasOne("PCC.Data.Models.PCCUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => + { + b.HasOne("PCC.Data.Models.PCCUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PCC.Data.Models.PCCUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => + { + b.HasOne("PCC.Data.Models.PCCUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("PCC.Data.Models.ParameterSettings", b => + { + b.HasOne("PCC.Data.Models.Setting", "Setting") + .WithMany() + .HasForeignKey("SettingId"); + + b.HasOne("PCC.Data.Models.Software", "Software") + .WithMany("ParametersPerSetting") + .HasForeignKey("SoftwareId"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Data/PCC.Data/Migrations/20210116105035_Secondary.cs b/src/Data/PCC.Data/Migrations/20210116105035_Secondary.cs new file mode 100644 index 0000000..5862b21 --- /dev/null +++ b/src/Data/PCC.Data/Migrations/20210116105035_Secondary.cs @@ -0,0 +1,67 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace PCC.Data.Migrations +{ + public partial class Secondary : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn<string>( + name: "ImageUrl", + table: "RAMs", + nullable: true); + + migrationBuilder.AddColumn<string>( + name: "ImageUrl", + table: "Processors", + nullable: true); + + migrationBuilder.AddColumn<string>( + name: "ImageUrl", + table: "PowerSupplies", + nullable: true); + + migrationBuilder.AddColumn<string>( + name: "ImageUrl", + table: "Motherboards", + nullable: true); + + migrationBuilder.AddColumn<string>( + name: "ImageUrl", + table: "HardDisks", + nullable: true); + + migrationBuilder.AddColumn<string>( + name: "ImageUrl", + table: "GPUs", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ImageUrl", + table: "RAMs"); + + migrationBuilder.DropColumn( + name: "ImageUrl", + table: "Processors"); + + migrationBuilder.DropColumn( + name: "ImageUrl", + table: "PowerSupplies"); + + migrationBuilder.DropColumn( + name: "ImageUrl", + table: "Motherboards"); + + migrationBuilder.DropColumn( + name: "ImageUrl", + table: "HardDisks"); + + migrationBuilder.DropColumn( + name: "ImageUrl", + table: "GPUs"); + } + } +} diff --git a/src/Data/PCC.Data/Migrations/20210117081721_Processor-Change-17.01.2021.Designer.cs b/src/Data/PCC.Data/Migrations/20210117081721_Processor-Change-17.01.2021.Designer.cs new file mode 100644 index 0000000..014edcc --- /dev/null +++ b/src/Data/PCC.Data/Migrations/20210117081721_Processor-Change-17.01.2021.Designer.cs @@ -0,0 +1,574 @@ +// <auto-generated /> +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using PCC.Data; + +namespace PCC.Data.Migrations +{ + [DbContext(typeof(PCCDbContext))] + [Migration("20210117081721_Processor-Change-17.01.2021")] + partial class ProcessorChange17012021 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.10") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Name") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property<string>("NormalizedName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => + { + b.Property<int>("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property<string>("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("RoleId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => + { + b.Property<int>("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property<string>("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => + { + b.Property<string>("LoginProvider") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property<string>("ProviderKey") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property<string>("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => + { + b.Property<string>("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("RoleId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => + { + b.Property<string>("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("LoginProvider") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property<string>("Name") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property<string>("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens"); + }); + + modelBuilder.Entity("PCC.Data.Models.PCCUser", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<int>("AccessFailedCount") + .HasColumnType("int"); + + b.Property<string>("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Email") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property<bool>("EmailConfirmed") + .HasColumnType("bit"); + + b.Property<bool>("LockoutEnabled") + .HasColumnType("bit"); + + b.Property<DateTimeOffset?>("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property<string>("NormalizedEmail") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property<string>("NormalizedUserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property<string>("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property<bool>("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property<string>("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property<bool>("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property<string>("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("AspNetUsers"); + }); + + modelBuilder.Entity("PCC.Data.Models.ParameterSettings", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<long>("RecommendedProcessorClockspeed") + .HasColumnType("bigint"); + + b.Property<long>("RecommendedProcessorCores") + .HasColumnType("bigint"); + + b.Property<string>("RecommendedProcessorGeneration") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("RecommendedRAM") + .HasColumnType("bigint"); + + b.Property<long>("RecommendedRAMSpeed") + .HasColumnType("bigint"); + + b.Property<string>("RecommendedRAMType") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("RecommendedStorageSpace") + .HasColumnType("bigint"); + + b.Property<long>("RecommendedVideoClockspeed") + .HasColumnType("bigint"); + + b.Property<string>("RecommendedVideoGeneration") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("RecommendedVideoMemory") + .HasColumnType("bigint"); + + b.Property<string>("SettingId") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("SoftwareId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("SettingId"); + + b.HasIndex("SoftwareId"); + + b.ToTable("ParameterSettings"); + }); + + modelBuilder.Entity("PCC.Data.Models.Parts.GPU", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("Clockspeed") + .HasColumnType("bigint"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("Generation") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("ImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("Memory") + .HasColumnType("bigint"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.ToTable("GPUs"); + }); + + modelBuilder.Entity("PCC.Data.Models.Parts.HardDisk", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("Capacity") + .HasColumnType("bigint"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("ImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property<bool>("IsSSD") + .HasColumnType("bit"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.Property<long>("Speed") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.ToTable("HardDisks"); + }); + + modelBuilder.Entity("PCC.Data.Models.Parts.Motherboard", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("CPUSupport") + .HasColumnType("nvarchar(max)"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("ImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("MemorySupport") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.ToTable("Motherboards"); + }); + + modelBuilder.Entity("PCC.Data.Models.Parts.PowerSupply", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("ImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.Property<int>("SupportedElectricalPowerConsumption") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("PowerSupplies"); + }); + + modelBuilder.Entity("PCC.Data.Models.Parts.RAM", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("Capacity") + .HasColumnType("bigint"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("ImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.Property<long>("Speed") + .HasColumnType("bigint"); + + b.Property<string>("Type") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("RAMs"); + }); + + modelBuilder.Entity("PCC.Data.Models.Processor", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("Clockspeed") + .HasColumnType("bigint"); + + b.Property<int>("Cores") + .HasColumnType("int"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("ImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.Property<string>("Socket") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Processors"); + }); + + modelBuilder.Entity("PCC.Data.Models.Setting", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<bool>("IsGame") + .HasColumnType("bit"); + + b.Property<string>("Name") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Settings"); + }); + + modelBuilder.Entity("PCC.Data.Models.Software", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Description") + .HasColumnType("nvarchar(max)"); + + b.Property<bool>("IsGame") + .HasColumnType("bit"); + + b.Property<string>("ParamatersId") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Title") + .HasColumnType("nvarchar(max)"); + + b.Property<int>("Year") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Softwares"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => + { + b.HasOne("PCC.Data.Models.PCCUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => + { + b.HasOne("PCC.Data.Models.PCCUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PCC.Data.Models.PCCUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => + { + b.HasOne("PCC.Data.Models.PCCUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("PCC.Data.Models.ParameterSettings", b => + { + b.HasOne("PCC.Data.Models.Setting", "Setting") + .WithMany() + .HasForeignKey("SettingId"); + + b.HasOne("PCC.Data.Models.Software", "Software") + .WithMany("ParametersPerSetting") + .HasForeignKey("SoftwareId"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Data/PCC.Data/Migrations/20210117081721_Processor-Change-17.01.2021.cs b/src/Data/PCC.Data/Migrations/20210117081721_Processor-Change-17.01.2021.cs new file mode 100644 index 0000000..d8143e5 --- /dev/null +++ b/src/Data/PCC.Data/Migrations/20210117081721_Processor-Change-17.01.2021.cs @@ -0,0 +1,32 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace PCC.Data.Migrations +{ + public partial class ProcessorChange17012021 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Generation", + table: "Processors"); + + migrationBuilder.AddColumn<string>( + name: "Socket", + table: "Processors", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Socket", + table: "Processors"); + + migrationBuilder.AddColumn<string>( + name: "Generation", + table: "Processors", + type: "nvarchar(max)", + nullable: true); + } + } +} diff --git a/src/Data/PCC.Data/Migrations/PCCDbContextModelSnapshot.cs b/src/Data/PCC.Data/Migrations/PCCDbContextModelSnapshot.cs new file mode 100644 index 0000000..313b08e --- /dev/null +++ b/src/Data/PCC.Data/Migrations/PCCDbContextModelSnapshot.cs @@ -0,0 +1,572 @@ +// <auto-generated /> +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using PCC.Data; + +namespace PCC.Data.Migrations +{ + [DbContext(typeof(PCCDbContext))] + partial class PCCDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.10") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Name") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property<string>("NormalizedName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => + { + b.Property<int>("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property<string>("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("RoleId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => + { + b.Property<int>("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property<string>("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => + { + b.Property<string>("LoginProvider") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property<string>("ProviderKey") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property<string>("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => + { + b.Property<string>("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("RoleId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => + { + b.Property<string>("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("LoginProvider") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property<string>("Name") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property<string>("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens"); + }); + + modelBuilder.Entity("PCC.Data.Models.PCCUser", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<int>("AccessFailedCount") + .HasColumnType("int"); + + b.Property<string>("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Email") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property<bool>("EmailConfirmed") + .HasColumnType("bit"); + + b.Property<bool>("LockoutEnabled") + .HasColumnType("bit"); + + b.Property<DateTimeOffset?>("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property<string>("NormalizedEmail") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property<string>("NormalizedUserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property<string>("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property<bool>("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property<string>("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property<bool>("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property<string>("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("AspNetUsers"); + }); + + modelBuilder.Entity("PCC.Data.Models.ParameterSettings", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<long>("RecommendedProcessorClockspeed") + .HasColumnType("bigint"); + + b.Property<long>("RecommendedProcessorCores") + .HasColumnType("bigint"); + + b.Property<string>("RecommendedProcessorGeneration") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("RecommendedRAM") + .HasColumnType("bigint"); + + b.Property<long>("RecommendedRAMSpeed") + .HasColumnType("bigint"); + + b.Property<string>("RecommendedRAMType") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("RecommendedStorageSpace") + .HasColumnType("bigint"); + + b.Property<long>("RecommendedVideoClockspeed") + .HasColumnType("bigint"); + + b.Property<string>("RecommendedVideoGeneration") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("RecommendedVideoMemory") + .HasColumnType("bigint"); + + b.Property<string>("SettingId") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("SoftwareId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("SettingId"); + + b.HasIndex("SoftwareId"); + + b.ToTable("ParameterSettings"); + }); + + modelBuilder.Entity("PCC.Data.Models.Parts.GPU", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("Clockspeed") + .HasColumnType("bigint"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("Generation") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("ImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("Memory") + .HasColumnType("bigint"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.ToTable("GPUs"); + }); + + modelBuilder.Entity("PCC.Data.Models.Parts.HardDisk", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("Capacity") + .HasColumnType("bigint"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("ImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property<bool>("IsSSD") + .HasColumnType("bit"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.Property<long>("Speed") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.ToTable("HardDisks"); + }); + + modelBuilder.Entity("PCC.Data.Models.Parts.Motherboard", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("CPUSupport") + .HasColumnType("nvarchar(max)"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("ImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("MemorySupport") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.ToTable("Motherboards"); + }); + + modelBuilder.Entity("PCC.Data.Models.Parts.PowerSupply", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("ImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.Property<int>("SupportedElectricalPowerConsumption") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("PowerSupplies"); + }); + + modelBuilder.Entity("PCC.Data.Models.Parts.RAM", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("Capacity") + .HasColumnType("bigint"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("ImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.Property<long>("Speed") + .HasColumnType("bigint"); + + b.Property<string>("Type") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("RAMs"); + }); + + modelBuilder.Entity("PCC.Data.Models.Processor", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Brand") + .HasColumnType("nvarchar(max)"); + + b.Property<long>("Clockspeed") + .HasColumnType("bigint"); + + b.Property<int>("Cores") + .HasColumnType("int"); + + b.Property<int>("ElectricalPowerConsumption") + .HasColumnType("int"); + + b.Property<string>("ImageUrl") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Model") + .HasColumnType("nvarchar(max)"); + + b.Property<decimal>("Price") + .HasColumnType("decimal(18,2)"); + + b.Property<string>("Socket") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Processors"); + }); + + modelBuilder.Entity("PCC.Data.Models.Setting", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<bool>("IsGame") + .HasColumnType("bit"); + + b.Property<string>("Name") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Settings"); + }); + + modelBuilder.Entity("PCC.Data.Models.Software", b => + { + b.Property<string>("Id") + .HasColumnType("nvarchar(450)"); + + b.Property<string>("Description") + .HasColumnType("nvarchar(max)"); + + b.Property<bool>("IsGame") + .HasColumnType("bit"); + + b.Property<string>("ParamatersId") + .HasColumnType("nvarchar(max)"); + + b.Property<string>("Title") + .HasColumnType("nvarchar(max)"); + + b.Property<int>("Year") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Softwares"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => + { + b.HasOne("PCC.Data.Models.PCCUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => + { + b.HasOne("PCC.Data.Models.PCCUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PCC.Data.Models.PCCUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => + { + b.HasOne("PCC.Data.Models.PCCUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("PCC.Data.Models.ParameterSettings", b => + { + b.HasOne("PCC.Data.Models.Setting", "Setting") + .WithMany() + .HasForeignKey("SettingId"); + + b.HasOne("PCC.Data.Models.Software", "Software") + .WithMany("ParametersPerSetting") + .HasForeignKey("SoftwareId"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Data/PCC.Data/PCC.Data.csproj b/src/Data/PCC.Data/PCC.Data.csproj new file mode 100644 index 0000000..aaebd24 --- /dev/null +++ b/src/Data/PCC.Data/PCC.Data.csproj @@ -0,0 +1,24 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>netcoreapp3.1</TargetFramework> + </PropertyGroup> + + <ItemGroup> + <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.10" /> + <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.10"> + <PrivateAssets>all</PrivateAssets> + <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> + </PackageReference> + <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.10" /> + <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.10"> + <PrivateAssets>all</PrivateAssets> + <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> + </PackageReference> + </ItemGroup> + + <ItemGroup> + <ProjectReference Include="..\PCC.Data.Models\PCC.Data.Models.csproj" /> + </ItemGroup> + +</Project> diff --git a/src/Data/PCC.Data/PCCDbContext.cs b/src/Data/PCC.Data/PCCDbContext.cs new file mode 100644 index 0000000..067c024 --- /dev/null +++ b/src/Data/PCC.Data/PCCDbContext.cs @@ -0,0 +1,39 @@ +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Identity.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using PCC.Data.Models; +using PCC.Data.Models.Parts; + +namespace PCC.Data +{ + public class PCCDbContext : IdentityDbContext<PCCUser, IdentityRole, string> + { + public DbSet<Setting> Settings { get; set; } + + public DbSet<ParameterSettings> ParameterSettings { get; set; } + + public DbSet<Software> Softwares { get; set; } + + public DbSet<GPU> GPUs { get; set; } + + public DbSet<HardDisk> HardDisks { get; set; } + + public DbSet<Motherboard> Motherboards { get; set; } + + public DbSet<PowerSupply> PowerSupplies { get; set; } + + public DbSet<Processor> Processors { get; set; } + + public DbSet<RAM> RAMs { get; set; } + + public PCCDbContext(DbContextOptions<PCCDbContext> options) + : base(options) + { + } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + } + } +} |