{
  "id": "779a3882-651b-446d-8967-3728aeea2888",
  "prevId": "00000000-0000-0000-0000-000000000000",
  "version": "7",
  "dialect": "postgresql",
  "tables": {
    "public.build_component": {
      "name": "build_component",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "build_id": {
          "name": "build_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "component_id": {
          "name": "component_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "build_component_build_id_build_id_fk": {
          "name": "build_component_build_id_build_id_fk",
          "tableFrom": "build_component",
          "tableTo": "build",
          "columnsFrom": [
            "build_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        },
        "build_component_component_id_components_id_fk": {
          "name": "build_component_component_id_components_id_fk",
          "tableFrom": "build_component",
          "tableTo": "components",
          "columnsFrom": [
            "component_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.build": {
      "name": "build",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "date",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "total_price": {
          "name": "total_price",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        },
        "is_approved": {
          "name": "is_approved",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "build_user_id_users_id_fk": {
          "name": "build_user_id_users_id_fk",
          "tableFrom": "build",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.favorite_build": {
      "name": "favorite_build",
      "schema": "",
      "columns": {
        "build_id": {
          "name": "build_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "favorite_build_build_id_build_id_fk": {
          "name": "favorite_build_build_id_build_id_fk",
          "tableFrom": "favorite_build",
          "tableTo": "build",
          "columnsFrom": [
            "build_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        },
        "favorite_build_user_id_users_id_fk": {
          "name": "favorite_build_user_id_users_id_fk",
          "tableFrom": "favorite_build",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {
        "favorite_build_build_id_user_id_pk": {
          "name": "favorite_build_build_id_user_id_pk",
          "columns": [
            "build_id",
            "user_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.rating_build": {
      "name": "rating_build",
      "schema": "",
      "columns": {
        "build_id": {
          "name": "build_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "value": {
          "name": "value",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "rating_build_build_id_build_id_fk": {
          "name": "rating_build_build_id_build_id_fk",
          "tableFrom": "rating_build",
          "tableTo": "build",
          "columnsFrom": [
            "build_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        },
        "rating_build_user_id_users_id_fk": {
          "name": "rating_build_user_id_users_id_fk",
          "tableFrom": "rating_build",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {
        "rating_build_build_id_user_id_pk": {
          "name": "rating_build_build_id_user_id_pk",
          "columns": [
            "build_id",
            "user_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {
        "check_value": {
          "name": "check_value",
          "value": "\"rating_build\".\"value\" BETWEEN 1 AND 5"
        }
      },
      "isRLSEnabled": false
    },
    "public.review": {
      "name": "review",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "build_id": {
          "name": "build_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "content": {
          "name": "content",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "date",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "review_build_id_build_id_fk": {
          "name": "review_build_id_build_id_fk",
          "tableFrom": "review",
          "tableTo": "build",
          "columnsFrom": [
            "build_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        },
        "review_user_id_users_id_fk": {
          "name": "review_user_id_users_id_fk",
          "tableFrom": "review",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "review_build_id_user_id_unique": {
          "name": "review_build_id_user_id_unique",
          "nullsNotDistinct": false,
          "columns": [
            "build_id",
            "user_id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.cpu": {
      "name": "cpu",
      "schema": "",
      "columns": {
        "component_id": {
          "name": "component_id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true
        },
        "socket": {
          "name": "socket",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "cores": {
          "name": "cores",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "threads": {
          "name": "threads",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "base_clock": {
          "name": "base_clock",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        },
        "boost_clock": {
          "name": "boost_clock",
          "type": "numeric",
          "primaryKey": false,
          "notNull": false
        },
        "tdp": {
          "name": "tdp",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "cpu_component_id_components_id_fk": {
          "name": "cpu_component_id_components_id_fk",
          "tableFrom": "cpu",
          "tableTo": "components",
          "columnsFrom": [
            "component_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.gpu": {
      "name": "gpu",
      "schema": "",
      "columns": {
        "component_id": {
          "name": "component_id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true
        },
        "vram": {
          "name": "vram",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        },
        "tdp": {
          "name": "tdp",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        },
        "base_clock": {
          "name": "base_clock",
          "type": "numeric",
          "primaryKey": false,
          "notNull": false
        },
        "boost_clock": {
          "name": "boost_clock",
          "type": "numeric",
          "primaryKey": false,
          "notNull": false
        },
        "chipset": {
          "name": "chipset",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "length": {
          "name": "length",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "gpu_component_id_components_id_fk": {
          "name": "gpu_component_id_components_id_fk",
          "tableFrom": "gpu",
          "tableTo": "components",
          "columnsFrom": [
            "component_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.cables": {
      "name": "cables",
      "schema": "",
      "columns": {
        "component_id": {
          "name": "component_id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true
        },
        "length_cm": {
          "name": "length_cm",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "cables_component_id_components_id_fk": {
          "name": "cables_component_id_components_id_fk",
          "tableFrom": "cables",
          "tableTo": "components",
          "columnsFrom": [
            "component_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.case_mobo_form_factors": {
      "name": "case_mobo_form_factors",
      "schema": "",
      "columns": {
        "case_id": {
          "name": "case_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "form_factor": {
          "name": "form_factor",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "case_mobo_form_factors_case_id_pc_case_component_id_fk": {
          "name": "case_mobo_form_factors_case_id_pc_case_component_id_fk",
          "tableFrom": "case_mobo_form_factors",
          "tableTo": "pc_case",
          "columnsFrom": [
            "case_id"
          ],
          "columnsTo": [
            "component_id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {
        "case_mobo_form_factors_case_id_form_factor_pk": {
          "name": "case_mobo_form_factors_case_id_form_factor_pk",
          "columns": [
            "case_id",
            "form_factor"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.case_ps_form_factors": {
      "name": "case_ps_form_factors",
      "schema": "",
      "columns": {
        "case_id": {
          "name": "case_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "form_factor": {
          "name": "form_factor",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "case_ps_form_factors_case_id_pc_case_component_id_fk": {
          "name": "case_ps_form_factors_case_id_pc_case_component_id_fk",
          "tableFrom": "case_ps_form_factors",
          "tableTo": "pc_case",
          "columnsFrom": [
            "case_id"
          ],
          "columnsTo": [
            "component_id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {
        "case_ps_form_factors_case_id_form_factor_pk": {
          "name": "case_ps_form_factors_case_id_form_factor_pk",
          "columns": [
            "case_id",
            "form_factor"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.case_storage_form_factors": {
      "name": "case_storage_form_factors",
      "schema": "",
      "columns": {
        "case_id": {
          "name": "case_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "form_factor": {
          "name": "form_factor",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "num_slots": {
          "name": "num_slots",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "case_storage_form_factors_case_id_pc_case_component_id_fk": {
          "name": "case_storage_form_factors_case_id_pc_case_component_id_fk",
          "tableFrom": "case_storage_form_factors",
          "tableTo": "pc_case",
          "columnsFrom": [
            "case_id"
          ],
          "columnsTo": [
            "component_id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {
        "case_storage_form_factors_case_id_form_factor_pk": {
          "name": "case_storage_form_factors_case_id_form_factor_pk",
          "columns": [
            "case_id",
            "form_factor"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.components": {
      "name": "components",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "brand": {
          "name": "brand",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "price": {
          "name": "price",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        },
        "img_url": {
          "name": "img_url",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "type": {
          "name": "type",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {
        "check_type": {
          "name": "check_type",
          "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')"
        }
      },
      "isRLSEnabled": false
    },
    "public.cooler_cpu_sockets": {
      "name": "cooler_cpu_sockets",
      "schema": "",
      "columns": {
        "cooler_id": {
          "name": "cooler_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "socket": {
          "name": "socket",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "cooler_cpu_sockets_cooler_id_cooler_component_id_fk": {
          "name": "cooler_cpu_sockets_cooler_id_cooler_component_id_fk",
          "tableFrom": "cooler_cpu_sockets",
          "tableTo": "cooler",
          "columnsFrom": [
            "cooler_id"
          ],
          "columnsTo": [
            "component_id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {
        "cooler_cpu_sockets_cooler_id_socket_pk": {
          "name": "cooler_cpu_sockets_cooler_id_socket_pk",
          "columns": [
            "cooler_id",
            "socket"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.cooler": {
      "name": "cooler",
      "schema": "",
      "columns": {
        "component_id": {
          "name": "component_id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "height": {
          "name": "height",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        },
        "max_tdp_supported": {
          "name": "max_tdp_supported",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "cooler_component_id_components_id_fk": {
          "name": "cooler_component_id_components_id_fk",
          "tableFrom": "cooler",
          "tableTo": "components",
          "columnsFrom": [
            "component_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.memory_card": {
      "name": "memory_card",
      "schema": "",
      "columns": {
        "component_id": {
          "name": "component_id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true
        },
        "num_slots": {
          "name": "num_slots",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "interface": {
          "name": "interface",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "memory_card_component_id_components_id_fk": {
          "name": "memory_card_component_id_components_id_fk",
          "tableFrom": "memory_card",
          "tableTo": "components",
          "columnsFrom": [
            "component_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.memory": {
      "name": "memory",
      "schema": "",
      "columns": {
        "component_id": {
          "name": "component_id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "speed": {
          "name": "speed",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        },
        "capacity": {
          "name": "capacity",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        },
        "modules": {
          "name": "modules",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "memory_component_id_components_id_fk": {
          "name": "memory_component_id_components_id_fk",
          "tableFrom": "memory",
          "tableTo": "components",
          "columnsFrom": [
            "component_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.motherboard": {
      "name": "motherboard",
      "schema": "",
      "columns": {
        "component_id": {
          "name": "component_id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true
        },
        "socket": {
          "name": "socket",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "chipset": {
          "name": "chipset",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "form_factor": {
          "name": "form_factor",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "ram_type": {
          "name": "ram_type",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "num_ram_slots": {
          "name": "num_ram_slots",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "max_ram_capacity": {
          "name": "max_ram_capacity",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        },
        "pci_express_slots": {
          "name": "pci_express_slots",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "motherboard_component_id_components_id_fk": {
          "name": "motherboard_component_id_components_id_fk",
          "tableFrom": "motherboard",
          "tableTo": "components",
          "columnsFrom": [
            "component_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.network_adapter": {
      "name": "network_adapter",
      "schema": "",
      "columns": {
        "component_id": {
          "name": "component_id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true
        },
        "wifi_version": {
          "name": "wifi_version",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "interface": {
          "name": "interface",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "num_antennas": {
          "name": "num_antennas",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "network_adapter_component_id_components_id_fk": {
          "name": "network_adapter_component_id_components_id_fk",
          "tableFrom": "network_adapter",
          "tableTo": "components",
          "columnsFrom": [
            "component_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.network_card": {
      "name": "network_card",
      "schema": "",
      "columns": {
        "component_id": {
          "name": "component_id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true
        },
        "num_ports": {
          "name": "num_ports",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "speed": {
          "name": "speed",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        },
        "interface": {
          "name": "interface",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "network_card_component_id_components_id_fk": {
          "name": "network_card_component_id_components_id_fk",
          "tableFrom": "network_card",
          "tableTo": "components",
          "columnsFrom": [
            "component_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.optical_drive": {
      "name": "optical_drive",
      "schema": "",
      "columns": {
        "component_id": {
          "name": "component_id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true
        },
        "form_factor": {
          "name": "form_factor",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "interface": {
          "name": "interface",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "write_speed": {
          "name": "write_speed",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        },
        "read_speed": {
          "name": "read_speed",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "optical_drive_component_id_components_id_fk": {
          "name": "optical_drive_component_id_components_id_fk",
          "tableFrom": "optical_drive",
          "tableTo": "components",
          "columnsFrom": [
            "component_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.pc_case": {
      "name": "pc_case",
      "schema": "",
      "columns": {
        "component_id": {
          "name": "component_id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true
        },
        "cooler_max_height": {
          "name": "cooler_max_height",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        },
        "gpu_max_length": {
          "name": "gpu_max_length",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "pc_case_component_id_components_id_fk": {
          "name": "pc_case_component_id_components_id_fk",
          "tableFrom": "pc_case",
          "tableTo": "components",
          "columnsFrom": [
            "component_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.power_supply": {
      "name": "power_supply",
      "schema": "",
      "columns": {
        "component_id": {
          "name": "component_id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "wattage": {
          "name": "wattage",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        },
        "form_factor": {
          "name": "form_factor",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "power_supply_component_id_components_id_fk": {
          "name": "power_supply_component_id_components_id_fk",
          "tableFrom": "power_supply",
          "tableTo": "components",
          "columnsFrom": [
            "component_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.sound_card": {
      "name": "sound_card",
      "schema": "",
      "columns": {
        "component_id": {
          "name": "component_id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true
        },
        "sample_rate": {
          "name": "sample_rate",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        },
        "bit_depth": {
          "name": "bit_depth",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        },
        "chipset": {
          "name": "chipset",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "interface": {
          "name": "interface",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "channel": {
          "name": "channel",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "sound_card_component_id_components_id_fk": {
          "name": "sound_card_component_id_components_id_fk",
          "tableFrom": "sound_card",
          "tableTo": "components",
          "columnsFrom": [
            "component_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.storage": {
      "name": "storage",
      "schema": "",
      "columns": {
        "component_id": {
          "name": "component_id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "capacity": {
          "name": "capacity",
          "type": "numeric",
          "primaryKey": false,
          "notNull": true
        },
        "form_factor": {
          "name": "form_factor",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "storage_component_id_components_id_fk": {
          "name": "storage_component_id_components_id_fk",
          "tableFrom": "storage",
          "tableTo": "components",
          "columnsFrom": [
            "component_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.admins": {
      "name": "admins",
      "schema": "",
      "columns": {
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "admins_user_id_users_id_fk": {
          "name": "admins_user_id_users_id_fk",
          "tableFrom": "admins",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.suggestions": {
      "name": "suggestions",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "admin_id": {
          "name": "admin_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "link": {
          "name": "link",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "admin_comment": {
          "name": "admin_comment",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'pending'"
        },
        "component_type": {
          "name": "component_type",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "suggestions_user_id_users_id_fk": {
          "name": "suggestions_user_id_users_id_fk",
          "tableFrom": "suggestions",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "cascade"
        },
        "suggestions_admin_id_admins_user_id_fk": {
          "name": "suggestions_admin_id_admins_user_id_fk",
          "tableFrom": "suggestions",
          "tableTo": "admins",
          "columnsFrom": [
            "admin_id"
          ],
          "columnsTo": [
            "user_id"
          ],
          "onDelete": "set null",
          "onUpdate": "cascade"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {
        "check_status": {
          "name": "check_status",
          "value": "\"suggestions\".\"status\" in ('pending', 'approved', 'rejected')"
        },
        "check_type": {
          "name": "check_type",
          "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')"
        }
      },
      "isRLSEnabled": false
    },
    "public.users": {
      "name": "users",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "username": {
          "name": "username",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "password": {
          "name": "password",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "email": {
          "name": "email",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "users_username_unique": {
          "name": "users_username_unique",
          "nullsNotDistinct": false,
          "columns": [
            "username"
          ]
        },
        "users_email_unique": {
          "name": "users_email_unique",
          "nullsNotDistinct": false,
          "columns": [
            "email"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    }
  },
  "enums": {},
  "schemas": {},
  "sequences": {},
  "roles": {},
  "policies": {},
  "views": {},
  "_meta": {
    "columns": {},
    "schemas": {},
    "tables": {}
  }
}