Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Data / PCC.Data / Migrations / 20201219095311_Initialized-PC-Parts.cs
blob: fd2e5ad10620b968c9a5cf18629d61005470a997 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
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");
        }
    }
}