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(nullable: false), Brand = table.Column(nullable: true), Model = table.Column(nullable: true), Price = table.Column(nullable: false), ElectricalPowerConsumption = table.Column(nullable: false), Memory = table.Column(nullable: false), Clockspeed = table.Column(nullable: false), Generation = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_GPUs", x => x.Id); }); migrationBuilder.CreateTable( name: "HardDisks", columns: table => new { Id = table.Column(nullable: false), Brand = table.Column(nullable: true), Model = table.Column(nullable: true), Price = table.Column(nullable: false), ElectricalPowerConsumption = table.Column(nullable: false), Capacity = table.Column(nullable: false), Speed = table.Column(nullable: false), IsSSD = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_HardDisks", x => x.Id); }); migrationBuilder.CreateTable( name: "Motherboards", columns: table => new { Id = table.Column(nullable: false), Brand = table.Column(nullable: true), Model = table.Column(nullable: true), Price = table.Column(nullable: false), ElectricalPowerConsumption = table.Column(nullable: false), CPUSupport = table.Column(nullable: true), MemorySupport = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Motherboards", x => x.Id); }); migrationBuilder.CreateTable( name: "PowerSupplies", columns: table => new { Id = table.Column(nullable: false), Brand = table.Column(nullable: true), Model = table.Column(nullable: true), Price = table.Column(nullable: false), ElectricalPowerConsumption = table.Column(nullable: false), SupportedElectricalPowerConsumption = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_PowerSupplies", x => x.Id); }); migrationBuilder.CreateTable( name: "Processors", columns: table => new { Id = table.Column(nullable: false), Brand = table.Column(nullable: true), Model = table.Column(nullable: true), Price = table.Column(nullable: false), ElectricalPowerConsumption = table.Column(nullable: false), Cores = table.Column(nullable: false), Clockspeed = table.Column(nullable: false), Generation = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Processors", x => x.Id); }); migrationBuilder.CreateTable( name: "RAMs", columns: table => new { Id = table.Column(nullable: false), Brand = table.Column(nullable: true), Model = table.Column(nullable: true), Price = table.Column(nullable: false), ElectricalPowerConsumption = table.Column(nullable: false), Capacity = table.Column(nullable: false), Type = table.Column(nullable: true), Speed = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_RAMs", x => x.Id); }); migrationBuilder.CreateTable( name: "Settings", columns: table => new { Id = table.Column(nullable: false), Name = table.Column(nullable: true), IsGame = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_Settings", x => x.Id); }); migrationBuilder.CreateTable( name: "Softwares", columns: table => new { Id = table.Column(nullable: false), Title = table.Column(nullable: true), Year = table.Column(nullable: false), Description = table.Column(nullable: true), IsGame = table.Column(nullable: false), ParamatersId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Softwares", x => x.Id); }); migrationBuilder.CreateTable( name: "ParameterSettings", columns: table => new { Id = table.Column(nullable: false), RecommendedRAM = table.Column(nullable: false), RecommendedRAMType = table.Column(nullable: true), RecommendedRAMSpeed = table.Column(nullable: false), RecommendedProcessorClockspeed = table.Column(nullable: false), RecommendedProcessorCores = table.Column(nullable: false), RecommendedProcessorGeneration = table.Column(nullable: true), RecommendedStorageSpace = table.Column(nullable: false), RecommendedVideoMemory = table.Column(nullable: false), RecommendedVideoClockspeed = table.Column(nullable: false), RecommendedVideoGeneration = table.Column(nullable: true), SettingId = table.Column(nullable: true), SoftwareId = table.Column(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"); } } }