R
R
RobQwerty2021-02-09 12:45:00
PostgreSQL
RobQwerty, 2021-02-09 12:45:00

How to organize a pattern for an online store on Laravel + PostgreSQL?

Greetings,
I just can’t figure out how to organize an e-store database on postgresql, namely:
1. Each product has its own unique characteristics, for example:
if these are mobile phones, then the characteristics are (standard: GSM, camera: 20mpx, infrared port: yes, well, etc.), and if it is a refrigerator - the characteristics will be as follows (Type of refrigerator: Two-chamber, Number of compressors: 1, Type of control: Electronic, etc.) - I don’t understand how to organize such a base ... But, there is one more nuance :
2. Looking through the html in some marketplaces, I saw the same characteristics in the categories, when adding a product, for example, Bluetooth TVs and refrigerators also have Bluetooth - in these categories, the "bluetooth" parameter has the same id. How can this be done with laravel and postgresql. Please do not judge strictly! Thank you in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Sokolov, 2021-02-09
@sergiks

Table of attributes id:1, title: "BlueTooth", type: "Boolean", ...
Table of classes (sets of attributes for a product) id: 1, title: Холодильник
Cross-tab: id_класса, id_признака
Products:title: Бирюза Х-1, id_класса: 1

N
netrox, 2021-02-09
@netrox

https://inviqa.com/blog/understanding-eav-data-mod...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question