source: database/migrations/meta/0000_snapshot.json@ ad211d1

main
Last change on this file since ad211d1 was ad211d1, checked in by Tome <gjorgievtome@…>, 6 months ago

Allow adding multiple components per build

  • Property mode set to 100644
File size: 39.2 KB
RevLine 
[ad211d1]1{
2 "id": "779a3882-651b-446d-8967-3728aeea2888",
3 "prevId": "00000000-0000-0000-0000-000000000000",
4 "version": "7",
5 "dialect": "postgresql",
6 "tables": {
7 "public.build_component": {
8 "name": "build_component",
9 "schema": "",
10 "columns": {
11 "id": {
12 "name": "id",
13 "type": "serial",
14 "primaryKey": true,
15 "notNull": true
16 },
17 "build_id": {
18 "name": "build_id",
19 "type": "integer",
20 "primaryKey": false,
21 "notNull": true
22 },
23 "component_id": {
24 "name": "component_id",
25 "type": "integer",
26 "primaryKey": false,
27 "notNull": true
28 }
29 },
30 "indexes": {},
31 "foreignKeys": {
32 "build_component_build_id_build_id_fk": {
33 "name": "build_component_build_id_build_id_fk",
34 "tableFrom": "build_component",
35 "tableTo": "build",
36 "columnsFrom": [
37 "build_id"
38 ],
39 "columnsTo": [
40 "id"
41 ],
42 "onDelete": "cascade",
43 "onUpdate": "cascade"
44 },
45 "build_component_component_id_components_id_fk": {
46 "name": "build_component_component_id_components_id_fk",
47 "tableFrom": "build_component",
48 "tableTo": "components",
49 "columnsFrom": [
50 "component_id"
51 ],
52 "columnsTo": [
53 "id"
54 ],
55 "onDelete": "cascade",
56 "onUpdate": "cascade"
57 }
58 },
59 "compositePrimaryKeys": {},
60 "uniqueConstraints": {},
61 "policies": {},
62 "checkConstraints": {},
63 "isRLSEnabled": false
64 },
65 "public.build": {
66 "name": "build",
67 "schema": "",
68 "columns": {
69 "id": {
70 "name": "id",
71 "type": "serial",
72 "primaryKey": true,
73 "notNull": true
74 },
75 "user_id": {
76 "name": "user_id",
77 "type": "integer",
78 "primaryKey": false,
79 "notNull": true
80 },
81 "name": {
82 "name": "name",
83 "type": "text",
84 "primaryKey": false,
85 "notNull": true
86 },
87 "created_at": {
88 "name": "created_at",
89 "type": "date",
90 "primaryKey": false,
91 "notNull": true
92 },
93 "description": {
94 "name": "description",
95 "type": "text",
96 "primaryKey": false,
97 "notNull": false
98 },
99 "total_price": {
100 "name": "total_price",
101 "type": "numeric",
102 "primaryKey": false,
103 "notNull": true
104 },
105 "is_approved": {
106 "name": "is_approved",
107 "type": "boolean",
108 "primaryKey": false,
109 "notNull": true
110 }
111 },
112 "indexes": {},
113 "foreignKeys": {
114 "build_user_id_users_id_fk": {
115 "name": "build_user_id_users_id_fk",
116 "tableFrom": "build",
117 "tableTo": "users",
118 "columnsFrom": [
119 "user_id"
120 ],
121 "columnsTo": [
122 "id"
123 ],
124 "onDelete": "cascade",
125 "onUpdate": "cascade"
126 }
127 },
128 "compositePrimaryKeys": {},
129 "uniqueConstraints": {},
130 "policies": {},
131 "checkConstraints": {},
132 "isRLSEnabled": false
133 },
134 "public.favorite_build": {
135 "name": "favorite_build",
136 "schema": "",
137 "columns": {
138 "build_id": {
139 "name": "build_id",
140 "type": "integer",
141 "primaryKey": false,
142 "notNull": true
143 },
144 "user_id": {
145 "name": "user_id",
146 "type": "integer",
147 "primaryKey": false,
148 "notNull": true
149 }
150 },
151 "indexes": {},
152 "foreignKeys": {
153 "favorite_build_build_id_build_id_fk": {
154 "name": "favorite_build_build_id_build_id_fk",
155 "tableFrom": "favorite_build",
156 "tableTo": "build",
157 "columnsFrom": [
158 "build_id"
159 ],
160 "columnsTo": [
161 "id"
162 ],
163 "onDelete": "cascade",
164 "onUpdate": "cascade"
165 },
166 "favorite_build_user_id_users_id_fk": {
167 "name": "favorite_build_user_id_users_id_fk",
168 "tableFrom": "favorite_build",
169 "tableTo": "users",
170 "columnsFrom": [
171 "user_id"
172 ],
173 "columnsTo": [
174 "id"
175 ],
176 "onDelete": "cascade",
177 "onUpdate": "cascade"
178 }
179 },
180 "compositePrimaryKeys": {
181 "favorite_build_build_id_user_id_pk": {
182 "name": "favorite_build_build_id_user_id_pk",
183 "columns": [
184 "build_id",
185 "user_id"
186 ]
187 }
188 },
189 "uniqueConstraints": {},
190 "policies": {},
191 "checkConstraints": {},
192 "isRLSEnabled": false
193 },
194 "public.rating_build": {
195 "name": "rating_build",
196 "schema": "",
197 "columns": {
198 "build_id": {
199 "name": "build_id",
200 "type": "integer",
201 "primaryKey": false,
202 "notNull": true
203 },
204 "user_id": {
205 "name": "user_id",
206 "type": "integer",
207 "primaryKey": false,
208 "notNull": true
209 },
210 "value": {
211 "name": "value",
212 "type": "numeric",
213 "primaryKey": false,
214 "notNull": true
215 }
216 },
217 "indexes": {},
218 "foreignKeys": {
219 "rating_build_build_id_build_id_fk": {
220 "name": "rating_build_build_id_build_id_fk",
221 "tableFrom": "rating_build",
222 "tableTo": "build",
223 "columnsFrom": [
224 "build_id"
225 ],
226 "columnsTo": [
227 "id"
228 ],
229 "onDelete": "cascade",
230 "onUpdate": "cascade"
231 },
232 "rating_build_user_id_users_id_fk": {
233 "name": "rating_build_user_id_users_id_fk",
234 "tableFrom": "rating_build",
235 "tableTo": "users",
236 "columnsFrom": [
237 "user_id"
238 ],
239 "columnsTo": [
240 "id"
241 ],
242 "onDelete": "cascade",
243 "onUpdate": "cascade"
244 }
245 },
246 "compositePrimaryKeys": {
247 "rating_build_build_id_user_id_pk": {
248 "name": "rating_build_build_id_user_id_pk",
249 "columns": [
250 "build_id",
251 "user_id"
252 ]
253 }
254 },
255 "uniqueConstraints": {},
256 "policies": {},
257 "checkConstraints": {
258 "check_value": {
259 "name": "check_value",
260 "value": "\"rating_build\".\"value\" BETWEEN 1 AND 5"
261 }
262 },
263 "isRLSEnabled": false
264 },
265 "public.review": {
266 "name": "review",
267 "schema": "",
268 "columns": {
269 "id": {
270 "name": "id",
271 "type": "serial",
272 "primaryKey": true,
273 "notNull": true
274 },
275 "build_id": {
276 "name": "build_id",
277 "type": "integer",
278 "primaryKey": false,
279 "notNull": true
280 },
281 "user_id": {
282 "name": "user_id",
283 "type": "integer",
284 "primaryKey": false,
285 "notNull": true
286 },
287 "content": {
288 "name": "content",
289 "type": "text",
290 "primaryKey": false,
291 "notNull": true
292 },
293 "created_at": {
294 "name": "created_at",
295 "type": "date",
296 "primaryKey": false,
297 "notNull": true
298 }
299 },
300 "indexes": {},
301 "foreignKeys": {
302 "review_build_id_build_id_fk": {
303 "name": "review_build_id_build_id_fk",
304 "tableFrom": "review",
305 "tableTo": "build",
306 "columnsFrom": [
307 "build_id"
308 ],
309 "columnsTo": [
310 "id"
311 ],
312 "onDelete": "cascade",
313 "onUpdate": "cascade"
314 },
315 "review_user_id_users_id_fk": {
316 "name": "review_user_id_users_id_fk",
317 "tableFrom": "review",
318 "tableTo": "users",
319 "columnsFrom": [
320 "user_id"
321 ],
322 "columnsTo": [
323 "id"
324 ],
325 "onDelete": "cascade",
326 "onUpdate": "cascade"
327 }
328 },
329 "compositePrimaryKeys": {},
330 "uniqueConstraints": {
331 "review_build_id_user_id_unique": {
332 "name": "review_build_id_user_id_unique",
333 "nullsNotDistinct": false,
334 "columns": [
335 "build_id",
336 "user_id"
337 ]
338 }
339 },
340 "policies": {},
341 "checkConstraints": {},
342 "isRLSEnabled": false
343 },
344 "public.cpu": {
345 "name": "cpu",
346 "schema": "",
347 "columns": {
348 "component_id": {
349 "name": "component_id",
350 "type": "integer",
351 "primaryKey": true,
352 "notNull": true
353 },
354 "socket": {
355 "name": "socket",
356 "type": "text",
357 "primaryKey": false,
358 "notNull": true
359 },
360 "cores": {
361 "name": "cores",
362 "type": "integer",
363 "primaryKey": false,
364 "notNull": true
365 },
366 "threads": {
367 "name": "threads",
368 "type": "integer",
369 "primaryKey": false,
370 "notNull": true
371 },
372 "base_clock": {
373 "name": "base_clock",
374 "type": "numeric",
375 "primaryKey": false,
376 "notNull": true
377 },
378 "boost_clock": {
379 "name": "boost_clock",
380 "type": "numeric",
381 "primaryKey": false,
382 "notNull": false
383 },
384 "tdp": {
385 "name": "tdp",
386 "type": "numeric",
387 "primaryKey": false,
388 "notNull": true
389 }
390 },
391 "indexes": {},
392 "foreignKeys": {
393 "cpu_component_id_components_id_fk": {
394 "name": "cpu_component_id_components_id_fk",
395 "tableFrom": "cpu",
396 "tableTo": "components",
397 "columnsFrom": [
398 "component_id"
399 ],
400 "columnsTo": [
401 "id"
402 ],
403 "onDelete": "cascade",
404 "onUpdate": "cascade"
405 }
406 },
407 "compositePrimaryKeys": {},
408 "uniqueConstraints": {},
409 "policies": {},
410 "checkConstraints": {},
411 "isRLSEnabled": false
412 },
413 "public.gpu": {
414 "name": "gpu",
415 "schema": "",
416 "columns": {
417 "component_id": {
418 "name": "component_id",
419 "type": "integer",
420 "primaryKey": true,
421 "notNull": true
422 },
423 "vram": {
424 "name": "vram",
425 "type": "numeric",
426 "primaryKey": false,
427 "notNull": true
428 },
429 "tdp": {
430 "name": "tdp",
431 "type": "numeric",
432 "primaryKey": false,
433 "notNull": true
434 },
435 "base_clock": {
436 "name": "base_clock",
437 "type": "numeric",
438 "primaryKey": false,
439 "notNull": false
440 },
441 "boost_clock": {
442 "name": "boost_clock",
443 "type": "numeric",
444 "primaryKey": false,
445 "notNull": false
446 },
447 "chipset": {
448 "name": "chipset",
449 "type": "text",
450 "primaryKey": false,
451 "notNull": true
452 },
453 "length": {
454 "name": "length",
455 "type": "numeric",
456 "primaryKey": false,
457 "notNull": true
458 }
459 },
460 "indexes": {},
461 "foreignKeys": {
462 "gpu_component_id_components_id_fk": {
463 "name": "gpu_component_id_components_id_fk",
464 "tableFrom": "gpu",
465 "tableTo": "components",
466 "columnsFrom": [
467 "component_id"
468 ],
469 "columnsTo": [
470 "id"
471 ],
472 "onDelete": "cascade",
473 "onUpdate": "cascade"
474 }
475 },
476 "compositePrimaryKeys": {},
477 "uniqueConstraints": {},
478 "policies": {},
479 "checkConstraints": {},
480 "isRLSEnabled": false
481 },
482 "public.cables": {
483 "name": "cables",
484 "schema": "",
485 "columns": {
486 "component_id": {
487 "name": "component_id",
488 "type": "integer",
489 "primaryKey": true,
490 "notNull": true
491 },
492 "length_cm": {
493 "name": "length_cm",
494 "type": "numeric",
495 "primaryKey": false,
496 "notNull": true
497 },
498 "type": {
499 "name": "type",
500 "type": "text",
501 "primaryKey": false,
502 "notNull": true
503 }
504 },
505 "indexes": {},
506 "foreignKeys": {
507 "cables_component_id_components_id_fk": {
508 "name": "cables_component_id_components_id_fk",
509 "tableFrom": "cables",
510 "tableTo": "components",
511 "columnsFrom": [
512 "component_id"
513 ],
514 "columnsTo": [
515 "id"
516 ],
517 "onDelete": "cascade",
518 "onUpdate": "cascade"
519 }
520 },
521 "compositePrimaryKeys": {},
522 "uniqueConstraints": {},
523 "policies": {},
524 "checkConstraints": {},
525 "isRLSEnabled": false
526 },
527 "public.case_mobo_form_factors": {
528 "name": "case_mobo_form_factors",
529 "schema": "",
530 "columns": {
531 "case_id": {
532 "name": "case_id",
533 "type": "integer",
534 "primaryKey": false,
535 "notNull": true
536 },
537 "form_factor": {
538 "name": "form_factor",
539 "type": "text",
540 "primaryKey": false,
541 "notNull": true
542 }
543 },
544 "indexes": {},
545 "foreignKeys": {
546 "case_mobo_form_factors_case_id_pc_case_component_id_fk": {
547 "name": "case_mobo_form_factors_case_id_pc_case_component_id_fk",
548 "tableFrom": "case_mobo_form_factors",
549 "tableTo": "pc_case",
550 "columnsFrom": [
551 "case_id"
552 ],
553 "columnsTo": [
554 "component_id"
555 ],
556 "onDelete": "cascade",
557 "onUpdate": "cascade"
558 }
559 },
560 "compositePrimaryKeys": {
561 "case_mobo_form_factors_case_id_form_factor_pk": {
562 "name": "case_mobo_form_factors_case_id_form_factor_pk",
563 "columns": [
564 "case_id",
565 "form_factor"
566 ]
567 }
568 },
569 "uniqueConstraints": {},
570 "policies": {},
571 "checkConstraints": {},
572 "isRLSEnabled": false
573 },
574 "public.case_ps_form_factors": {
575 "name": "case_ps_form_factors",
576 "schema": "",
577 "columns": {
578 "case_id": {
579 "name": "case_id",
580 "type": "integer",
581 "primaryKey": false,
582 "notNull": true
583 },
584 "form_factor": {
585 "name": "form_factor",
586 "type": "text",
587 "primaryKey": false,
588 "notNull": true
589 }
590 },
591 "indexes": {},
592 "foreignKeys": {
593 "case_ps_form_factors_case_id_pc_case_component_id_fk": {
594 "name": "case_ps_form_factors_case_id_pc_case_component_id_fk",
595 "tableFrom": "case_ps_form_factors",
596 "tableTo": "pc_case",
597 "columnsFrom": [
598 "case_id"
599 ],
600 "columnsTo": [
601 "component_id"
602 ],
603 "onDelete": "cascade",
604 "onUpdate": "cascade"
605 }
606 },
607 "compositePrimaryKeys": {
608 "case_ps_form_factors_case_id_form_factor_pk": {
609 "name": "case_ps_form_factors_case_id_form_factor_pk",
610 "columns": [
611 "case_id",
612 "form_factor"
613 ]
614 }
615 },
616 "uniqueConstraints": {},
617 "policies": {},
618 "checkConstraints": {},
619 "isRLSEnabled": false
620 },
621 "public.case_storage_form_factors": {
622 "name": "case_storage_form_factors",
623 "schema": "",
624 "columns": {
625 "case_id": {
626 "name": "case_id",
627 "type": "integer",
628 "primaryKey": false,
629 "notNull": true
630 },
631 "form_factor": {
632 "name": "form_factor",
633 "type": "text",
634 "primaryKey": false,
635 "notNull": true
636 },
637 "num_slots": {
638 "name": "num_slots",
639 "type": "integer",
640 "primaryKey": false,
641 "notNull": true
642 }
643 },
644 "indexes": {},
645 "foreignKeys": {
646 "case_storage_form_factors_case_id_pc_case_component_id_fk": {
647 "name": "case_storage_form_factors_case_id_pc_case_component_id_fk",
648 "tableFrom": "case_storage_form_factors",
649 "tableTo": "pc_case",
650 "columnsFrom": [
651 "case_id"
652 ],
653 "columnsTo": [
654 "component_id"
655 ],
656 "onDelete": "cascade",
657 "onUpdate": "cascade"
658 }
659 },
660 "compositePrimaryKeys": {
661 "case_storage_form_factors_case_id_form_factor_pk": {
662 "name": "case_storage_form_factors_case_id_form_factor_pk",
663 "columns": [
664 "case_id",
665 "form_factor"
666 ]
667 }
668 },
669 "uniqueConstraints": {},
670 "policies": {},
671 "checkConstraints": {},
672 "isRLSEnabled": false
673 },
674 "public.components": {
675 "name": "components",
676 "schema": "",
677 "columns": {
678 "id": {
679 "name": "id",
680 "type": "serial",
681 "primaryKey": true,
682 "notNull": true
683 },
684 "name": {
685 "name": "name",
686 "type": "text",
687 "primaryKey": false,
688 "notNull": true
689 },
690 "brand": {
691 "name": "brand",
692 "type": "text",
693 "primaryKey": false,
694 "notNull": true
695 },
696 "price": {
697 "name": "price",
698 "type": "numeric",
699 "primaryKey": false,
700 "notNull": true
701 },
702 "img_url": {
703 "name": "img_url",
704 "type": "text",
705 "primaryKey": false,
706 "notNull": false
707 },
708 "type": {
709 "name": "type",
710 "type": "text",
711 "primaryKey": false,
712 "notNull": true
713 }
714 },
715 "indexes": {},
716 "foreignKeys": {},
717 "compositePrimaryKeys": {},
718 "uniqueConstraints": {},
719 "policies": {},
720 "checkConstraints": {
721 "check_type": {
722 "name": "check_type",
723 "value": "\"components\".\"type\" in \n ('cpu', 'gpu', 'memory', 'storage', 'power_supply', 'motherboard', 'case', 'cooler', 'memory_card', 'optical_drive', 'sound_card', 'cables', 'network_adapter', 'network_card')"
724 }
725 },
726 "isRLSEnabled": false
727 },
728 "public.cooler_cpu_sockets": {
729 "name": "cooler_cpu_sockets",
730 "schema": "",
731 "columns": {
732 "cooler_id": {
733 "name": "cooler_id",
734 "type": "integer",
735 "primaryKey": false,
736 "notNull": true
737 },
738 "socket": {
739 "name": "socket",
740 "type": "text",
741 "primaryKey": false,
742 "notNull": true
743 }
744 },
745 "indexes": {},
746 "foreignKeys": {
747 "cooler_cpu_sockets_cooler_id_cooler_component_id_fk": {
748 "name": "cooler_cpu_sockets_cooler_id_cooler_component_id_fk",
749 "tableFrom": "cooler_cpu_sockets",
750 "tableTo": "cooler",
751 "columnsFrom": [
752 "cooler_id"
753 ],
754 "columnsTo": [
755 "component_id"
756 ],
757 "onDelete": "cascade",
758 "onUpdate": "cascade"
759 }
760 },
761 "compositePrimaryKeys": {
762 "cooler_cpu_sockets_cooler_id_socket_pk": {
763 "name": "cooler_cpu_sockets_cooler_id_socket_pk",
764 "columns": [
765 "cooler_id",
766 "socket"
767 ]
768 }
769 },
770 "uniqueConstraints": {},
771 "policies": {},
772 "checkConstraints": {},
773 "isRLSEnabled": false
774 },
775 "public.cooler": {
776 "name": "cooler",
777 "schema": "",
778 "columns": {
779 "component_id": {
780 "name": "component_id",
781 "type": "integer",
782 "primaryKey": true,
783 "notNull": true
784 },
785 "type": {
786 "name": "type",
787 "type": "text",
788 "primaryKey": false,
789 "notNull": true
790 },
791 "height": {
792 "name": "height",
793 "type": "numeric",
794 "primaryKey": false,
795 "notNull": true
796 },
797 "max_tdp_supported": {
798 "name": "max_tdp_supported",
799 "type": "numeric",
800 "primaryKey": false,
801 "notNull": true
802 }
803 },
804 "indexes": {},
805 "foreignKeys": {
806 "cooler_component_id_components_id_fk": {
807 "name": "cooler_component_id_components_id_fk",
808 "tableFrom": "cooler",
809 "tableTo": "components",
810 "columnsFrom": [
811 "component_id"
812 ],
813 "columnsTo": [
814 "id"
815 ],
816 "onDelete": "cascade",
817 "onUpdate": "cascade"
818 }
819 },
820 "compositePrimaryKeys": {},
821 "uniqueConstraints": {},
822 "policies": {},
823 "checkConstraints": {},
824 "isRLSEnabled": false
825 },
826 "public.memory_card": {
827 "name": "memory_card",
828 "schema": "",
829 "columns": {
830 "component_id": {
831 "name": "component_id",
832 "type": "integer",
833 "primaryKey": true,
834 "notNull": true
835 },
836 "num_slots": {
837 "name": "num_slots",
838 "type": "integer",
839 "primaryKey": false,
840 "notNull": true
841 },
842 "interface": {
843 "name": "interface",
844 "type": "text",
845 "primaryKey": false,
846 "notNull": true
847 }
848 },
849 "indexes": {},
850 "foreignKeys": {
851 "memory_card_component_id_components_id_fk": {
852 "name": "memory_card_component_id_components_id_fk",
853 "tableFrom": "memory_card",
854 "tableTo": "components",
855 "columnsFrom": [
856 "component_id"
857 ],
858 "columnsTo": [
859 "id"
860 ],
861 "onDelete": "cascade",
862 "onUpdate": "cascade"
863 }
864 },
865 "compositePrimaryKeys": {},
866 "uniqueConstraints": {},
867 "policies": {},
868 "checkConstraints": {},
869 "isRLSEnabled": false
870 },
871 "public.memory": {
872 "name": "memory",
873 "schema": "",
874 "columns": {
875 "component_id": {
876 "name": "component_id",
877 "type": "integer",
878 "primaryKey": true,
879 "notNull": true
880 },
881 "type": {
882 "name": "type",
883 "type": "text",
884 "primaryKey": false,
885 "notNull": true
886 },
887 "speed": {
888 "name": "speed",
889 "type": "numeric",
890 "primaryKey": false,
891 "notNull": true
892 },
893 "capacity": {
894 "name": "capacity",
895 "type": "numeric",
896 "primaryKey": false,
897 "notNull": true
898 },
899 "modules": {
900 "name": "modules",
901 "type": "integer",
902 "primaryKey": false,
903 "notNull": true
904 }
905 },
906 "indexes": {},
907 "foreignKeys": {
908 "memory_component_id_components_id_fk": {
909 "name": "memory_component_id_components_id_fk",
910 "tableFrom": "memory",
911 "tableTo": "components",
912 "columnsFrom": [
913 "component_id"
914 ],
915 "columnsTo": [
916 "id"
917 ],
918 "onDelete": "cascade",
919 "onUpdate": "cascade"
920 }
921 },
922 "compositePrimaryKeys": {},
923 "uniqueConstraints": {},
924 "policies": {},
925 "checkConstraints": {},
926 "isRLSEnabled": false
927 },
928 "public.motherboard": {
929 "name": "motherboard",
930 "schema": "",
931 "columns": {
932 "component_id": {
933 "name": "component_id",
934 "type": "integer",
935 "primaryKey": true,
936 "notNull": true
937 },
938 "socket": {
939 "name": "socket",
940 "type": "text",
941 "primaryKey": false,
942 "notNull": true
943 },
944 "chipset": {
945 "name": "chipset",
946 "type": "text",
947 "primaryKey": false,
948 "notNull": true
949 },
950 "form_factor": {
951 "name": "form_factor",
952 "type": "text",
953 "primaryKey": false,
954 "notNull": true
955 },
956 "ram_type": {
957 "name": "ram_type",
958 "type": "text",
959 "primaryKey": false,
960 "notNull": true
961 },
962 "num_ram_slots": {
963 "name": "num_ram_slots",
964 "type": "integer",
965 "primaryKey": false,
966 "notNull": true
967 },
968 "max_ram_capacity": {
969 "name": "max_ram_capacity",
970 "type": "numeric",
971 "primaryKey": false,
972 "notNull": true
973 },
974 "pci_express_slots": {
975 "name": "pci_express_slots",
976 "type": "numeric",
977 "primaryKey": false,
978 "notNull": true
979 }
980 },
981 "indexes": {},
982 "foreignKeys": {
983 "motherboard_component_id_components_id_fk": {
984 "name": "motherboard_component_id_components_id_fk",
985 "tableFrom": "motherboard",
986 "tableTo": "components",
987 "columnsFrom": [
988 "component_id"
989 ],
990 "columnsTo": [
991 "id"
992 ],
993 "onDelete": "cascade",
994 "onUpdate": "cascade"
995 }
996 },
997 "compositePrimaryKeys": {},
998 "uniqueConstraints": {},
999 "policies": {},
1000 "checkConstraints": {},
1001 "isRLSEnabled": false
1002 },
1003 "public.network_adapter": {
1004 "name": "network_adapter",
1005 "schema": "",
1006 "columns": {
1007 "component_id": {
1008 "name": "component_id",
1009 "type": "integer",
1010 "primaryKey": true,
1011 "notNull": true
1012 },
1013 "wifi_version": {
1014 "name": "wifi_version",
1015 "type": "text",
1016 "primaryKey": false,
1017 "notNull": true
1018 },
1019 "interface": {
1020 "name": "interface",
1021 "type": "text",
1022 "primaryKey": false,
1023 "notNull": true
1024 },
1025 "num_antennas": {
1026 "name": "num_antennas",
1027 "type": "integer",
1028 "primaryKey": false,
1029 "notNull": true
1030 }
1031 },
1032 "indexes": {},
1033 "foreignKeys": {
1034 "network_adapter_component_id_components_id_fk": {
1035 "name": "network_adapter_component_id_components_id_fk",
1036 "tableFrom": "network_adapter",
1037 "tableTo": "components",
1038 "columnsFrom": [
1039 "component_id"
1040 ],
1041 "columnsTo": [
1042 "id"
1043 ],
1044 "onDelete": "cascade",
1045 "onUpdate": "cascade"
1046 }
1047 },
1048 "compositePrimaryKeys": {},
1049 "uniqueConstraints": {},
1050 "policies": {},
1051 "checkConstraints": {},
1052 "isRLSEnabled": false
1053 },
1054 "public.network_card": {
1055 "name": "network_card",
1056 "schema": "",
1057 "columns": {
1058 "component_id": {
1059 "name": "component_id",
1060 "type": "integer",
1061 "primaryKey": true,
1062 "notNull": true
1063 },
1064 "num_ports": {
1065 "name": "num_ports",
1066 "type": "integer",
1067 "primaryKey": false,
1068 "notNull": true
1069 },
1070 "speed": {
1071 "name": "speed",
1072 "type": "numeric",
1073 "primaryKey": false,
1074 "notNull": true
1075 },
1076 "interface": {
1077 "name": "interface",
1078 "type": "text",
1079 "primaryKey": false,
1080 "notNull": true
1081 }
1082 },
1083 "indexes": {},
1084 "foreignKeys": {
1085 "network_card_component_id_components_id_fk": {
1086 "name": "network_card_component_id_components_id_fk",
1087 "tableFrom": "network_card",
1088 "tableTo": "components",
1089 "columnsFrom": [
1090 "component_id"
1091 ],
1092 "columnsTo": [
1093 "id"
1094 ],
1095 "onDelete": "cascade",
1096 "onUpdate": "cascade"
1097 }
1098 },
1099 "compositePrimaryKeys": {},
1100 "uniqueConstraints": {},
1101 "policies": {},
1102 "checkConstraints": {},
1103 "isRLSEnabled": false
1104 },
1105 "public.optical_drive": {
1106 "name": "optical_drive",
1107 "schema": "",
1108 "columns": {
1109 "component_id": {
1110 "name": "component_id",
1111 "type": "integer",
1112 "primaryKey": true,
1113 "notNull": true
1114 },
1115 "form_factor": {
1116 "name": "form_factor",
1117 "type": "text",
1118 "primaryKey": false,
1119 "notNull": true
1120 },
1121 "type": {
1122 "name": "type",
1123 "type": "text",
1124 "primaryKey": false,
1125 "notNull": true
1126 },
1127 "interface": {
1128 "name": "interface",
1129 "type": "text",
1130 "primaryKey": false,
1131 "notNull": true
1132 },
1133 "write_speed": {
1134 "name": "write_speed",
1135 "type": "numeric",
1136 "primaryKey": false,
1137 "notNull": true
1138 },
1139 "read_speed": {
1140 "name": "read_speed",
1141 "type": "numeric",
1142 "primaryKey": false,
1143 "notNull": true
1144 }
1145 },
1146 "indexes": {},
1147 "foreignKeys": {
1148 "optical_drive_component_id_components_id_fk": {
1149 "name": "optical_drive_component_id_components_id_fk",
1150 "tableFrom": "optical_drive",
1151 "tableTo": "components",
1152 "columnsFrom": [
1153 "component_id"
1154 ],
1155 "columnsTo": [
1156 "id"
1157 ],
1158 "onDelete": "cascade",
1159 "onUpdate": "cascade"
1160 }
1161 },
1162 "compositePrimaryKeys": {},
1163 "uniqueConstraints": {},
1164 "policies": {},
1165 "checkConstraints": {},
1166 "isRLSEnabled": false
1167 },
1168 "public.pc_case": {
1169 "name": "pc_case",
1170 "schema": "",
1171 "columns": {
1172 "component_id": {
1173 "name": "component_id",
1174 "type": "integer",
1175 "primaryKey": true,
1176 "notNull": true
1177 },
1178 "cooler_max_height": {
1179 "name": "cooler_max_height",
1180 "type": "numeric",
1181 "primaryKey": false,
1182 "notNull": true
1183 },
1184 "gpu_max_length": {
1185 "name": "gpu_max_length",
1186 "type": "numeric",
1187 "primaryKey": false,
1188 "notNull": true
1189 }
1190 },
1191 "indexes": {},
1192 "foreignKeys": {
1193 "pc_case_component_id_components_id_fk": {
1194 "name": "pc_case_component_id_components_id_fk",
1195 "tableFrom": "pc_case",
1196 "tableTo": "components",
1197 "columnsFrom": [
1198 "component_id"
1199 ],
1200 "columnsTo": [
1201 "id"
1202 ],
1203 "onDelete": "cascade",
1204 "onUpdate": "cascade"
1205 }
1206 },
1207 "compositePrimaryKeys": {},
1208 "uniqueConstraints": {},
1209 "policies": {},
1210 "checkConstraints": {},
1211 "isRLSEnabled": false
1212 },
1213 "public.power_supply": {
1214 "name": "power_supply",
1215 "schema": "",
1216 "columns": {
1217 "component_id": {
1218 "name": "component_id",
1219 "type": "integer",
1220 "primaryKey": true,
1221 "notNull": true
1222 },
1223 "type": {
1224 "name": "type",
1225 "type": "text",
1226 "primaryKey": false,
1227 "notNull": true
1228 },
1229 "wattage": {
1230 "name": "wattage",
1231 "type": "numeric",
1232 "primaryKey": false,
1233 "notNull": true
1234 },
1235 "form_factor": {
1236 "name": "form_factor",
1237 "type": "text",
1238 "primaryKey": false,
1239 "notNull": true
1240 }
1241 },
1242 "indexes": {},
1243 "foreignKeys": {
1244 "power_supply_component_id_components_id_fk": {
1245 "name": "power_supply_component_id_components_id_fk",
1246 "tableFrom": "power_supply",
1247 "tableTo": "components",
1248 "columnsFrom": [
1249 "component_id"
1250 ],
1251 "columnsTo": [
1252 "id"
1253 ],
1254 "onDelete": "cascade",
1255 "onUpdate": "cascade"
1256 }
1257 },
1258 "compositePrimaryKeys": {},
1259 "uniqueConstraints": {},
1260 "policies": {},
1261 "checkConstraints": {},
1262 "isRLSEnabled": false
1263 },
1264 "public.sound_card": {
1265 "name": "sound_card",
1266 "schema": "",
1267 "columns": {
1268 "component_id": {
1269 "name": "component_id",
1270 "type": "integer",
1271 "primaryKey": true,
1272 "notNull": true
1273 },
1274 "sample_rate": {
1275 "name": "sample_rate",
1276 "type": "numeric",
1277 "primaryKey": false,
1278 "notNull": true
1279 },
1280 "bit_depth": {
1281 "name": "bit_depth",
1282 "type": "numeric",
1283 "primaryKey": false,
1284 "notNull": true
1285 },
1286 "chipset": {
1287 "name": "chipset",
1288 "type": "text",
1289 "primaryKey": false,
1290 "notNull": true
1291 },
1292 "interface": {
1293 "name": "interface",
1294 "type": "text",
1295 "primaryKey": false,
1296 "notNull": true
1297 },
1298 "channel": {
1299 "name": "channel",
1300 "type": "text",
1301 "primaryKey": false,
1302 "notNull": true
1303 }
1304 },
1305 "indexes": {},
1306 "foreignKeys": {
1307 "sound_card_component_id_components_id_fk": {
1308 "name": "sound_card_component_id_components_id_fk",
1309 "tableFrom": "sound_card",
1310 "tableTo": "components",
1311 "columnsFrom": [
1312 "component_id"
1313 ],
1314 "columnsTo": [
1315 "id"
1316 ],
1317 "onDelete": "cascade",
1318 "onUpdate": "cascade"
1319 }
1320 },
1321 "compositePrimaryKeys": {},
1322 "uniqueConstraints": {},
1323 "policies": {},
1324 "checkConstraints": {},
1325 "isRLSEnabled": false
1326 },
1327 "public.storage": {
1328 "name": "storage",
1329 "schema": "",
1330 "columns": {
1331 "component_id": {
1332 "name": "component_id",
1333 "type": "integer",
1334 "primaryKey": true,
1335 "notNull": true
1336 },
1337 "type": {
1338 "name": "type",
1339 "type": "text",
1340 "primaryKey": false,
1341 "notNull": true
1342 },
1343 "capacity": {
1344 "name": "capacity",
1345 "type": "numeric",
1346 "primaryKey": false,
1347 "notNull": true
1348 },
1349 "form_factor": {
1350 "name": "form_factor",
1351 "type": "text",
1352 "primaryKey": false,
1353 "notNull": true
1354 }
1355 },
1356 "indexes": {},
1357 "foreignKeys": {
1358 "storage_component_id_components_id_fk": {
1359 "name": "storage_component_id_components_id_fk",
1360 "tableFrom": "storage",
1361 "tableTo": "components",
1362 "columnsFrom": [
1363 "component_id"
1364 ],
1365 "columnsTo": [
1366 "id"
1367 ],
1368 "onDelete": "cascade",
1369 "onUpdate": "cascade"
1370 }
1371 },
1372 "compositePrimaryKeys": {},
1373 "uniqueConstraints": {},
1374 "policies": {},
1375 "checkConstraints": {},
1376 "isRLSEnabled": false
1377 },
1378 "public.admins": {
1379 "name": "admins",
1380 "schema": "",
1381 "columns": {
1382 "user_id": {
1383 "name": "user_id",
1384 "type": "integer",
1385 "primaryKey": true,
1386 "notNull": true
1387 }
1388 },
1389 "indexes": {},
1390 "foreignKeys": {
1391 "admins_user_id_users_id_fk": {
1392 "name": "admins_user_id_users_id_fk",
1393 "tableFrom": "admins",
1394 "tableTo": "users",
1395 "columnsFrom": [
1396 "user_id"
1397 ],
1398 "columnsTo": [
1399 "id"
1400 ],
1401 "onDelete": "cascade",
1402 "onUpdate": "cascade"
1403 }
1404 },
1405 "compositePrimaryKeys": {},
1406 "uniqueConstraints": {},
1407 "policies": {},
1408 "checkConstraints": {},
1409 "isRLSEnabled": false
1410 },
1411 "public.suggestions": {
1412 "name": "suggestions",
1413 "schema": "",
1414 "columns": {
1415 "id": {
1416 "name": "id",
1417 "type": "serial",
1418 "primaryKey": true,
1419 "notNull": true
1420 },
1421 "user_id": {
1422 "name": "user_id",
1423 "type": "integer",
1424 "primaryKey": false,
1425 "notNull": true
1426 },
1427 "admin_id": {
1428 "name": "admin_id",
1429 "type": "integer",
1430 "primaryKey": false,
1431 "notNull": false
1432 },
1433 "link": {
1434 "name": "link",
1435 "type": "text",
1436 "primaryKey": false,
1437 "notNull": true
1438 },
1439 "admin_comment": {
1440 "name": "admin_comment",
1441 "type": "text",
1442 "primaryKey": false,
1443 "notNull": false
1444 },
1445 "description": {
1446 "name": "description",
1447 "type": "text",
1448 "primaryKey": false,
1449 "notNull": false
1450 },
1451 "status": {
1452 "name": "status",
1453 "type": "text",
1454 "primaryKey": false,
1455 "notNull": true,
1456 "default": "'pending'"
1457 },
1458 "component_type": {
1459 "name": "component_type",
1460 "type": "text",
1461 "primaryKey": false,
1462 "notNull": true
1463 }
1464 },
1465 "indexes": {},
1466 "foreignKeys": {
1467 "suggestions_user_id_users_id_fk": {
1468 "name": "suggestions_user_id_users_id_fk",
1469 "tableFrom": "suggestions",
1470 "tableTo": "users",
1471 "columnsFrom": [
1472 "user_id"
1473 ],
1474 "columnsTo": [
1475 "id"
1476 ],
1477 "onDelete": "cascade",
1478 "onUpdate": "cascade"
1479 },
1480 "suggestions_admin_id_admins_user_id_fk": {
1481 "name": "suggestions_admin_id_admins_user_id_fk",
1482 "tableFrom": "suggestions",
1483 "tableTo": "admins",
1484 "columnsFrom": [
1485 "admin_id"
1486 ],
1487 "columnsTo": [
1488 "user_id"
1489 ],
1490 "onDelete": "set null",
1491 "onUpdate": "cascade"
1492 }
1493 },
1494 "compositePrimaryKeys": {},
1495 "uniqueConstraints": {},
1496 "policies": {},
1497 "checkConstraints": {
1498 "check_status": {
1499 "name": "check_status",
1500 "value": "\"suggestions\".\"status\" in ('pending', 'approved', 'rejected')"
1501 },
1502 "check_type": {
1503 "name": "check_type",
1504 "value": "\"suggestions\".\"component_type\" in \n ('cpu', 'gpu', 'memory', 'storage', 'power_supply', 'motherboard', 'case', 'cooler', 'memory_card', 'optical_drive', 'sound_card', 'cables', 'network_adapter', 'network_card')"
1505 }
1506 },
1507 "isRLSEnabled": false
1508 },
1509 "public.users": {
1510 "name": "users",
1511 "schema": "",
1512 "columns": {
1513 "id": {
1514 "name": "id",
1515 "type": "serial",
1516 "primaryKey": true,
1517 "notNull": true
1518 },
1519 "username": {
1520 "name": "username",
1521 "type": "text",
1522 "primaryKey": false,
1523 "notNull": true
1524 },
1525 "password": {
1526 "name": "password",
1527 "type": "text",
1528 "primaryKey": false,
1529 "notNull": true
1530 },
1531 "email": {
1532 "name": "email",
1533 "type": "text",
1534 "primaryKey": false,
1535 "notNull": true
1536 }
1537 },
1538 "indexes": {},
1539 "foreignKeys": {},
1540 "compositePrimaryKeys": {},
1541 "uniqueConstraints": {
1542 "users_username_unique": {
1543 "name": "users_username_unique",
1544 "nullsNotDistinct": false,
1545 "columns": [
1546 "username"
1547 ]
1548 },
1549 "users_email_unique": {
1550 "name": "users_email_unique",
1551 "nullsNotDistinct": false,
1552 "columns": [
1553 "email"
1554 ]
1555 }
1556 },
1557 "policies": {},
1558 "checkConstraints": {},
1559 "isRLSEnabled": false
1560 }
1561 },
1562 "enums": {},
1563 "schemas": {},
1564 "sequences": {},
1565 "roles": {},
1566 "policies": {},
1567 "views": {},
1568 "_meta": {
1569 "columns": {},
1570 "schemas": {},
1571 "tables": {}
1572 }
1573}
Note: See TracBrowser for help on using the repository browser.