source: database/migrations/meta/0000_snapshot.json@ 9e9293a

main
Last change on this file since 9e9293a was 9137793, checked in by Tome <gjorgievtome@…>, 7 months ago

Fix migration and db seeding

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