0

I want to know the way to design database for product data (variation-variables data)

Example

I have those tables:

Products: id - Title
Attributes: id - name
Options : id - name - attribute_id

Each product has one or more attributes, and each attributes has one or more options.

This is the setup I have in mind:

Table product_attribute_option:

ID - price - sale_price - qty - product_id - attribute_id - option_id

My question is how to manage this situation with a migration and a database?

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
  • Take a look at existing solutions and recreate them. They've proven (mostly) failproof. For instance Magento' EAP system. (Magento 1, I haven't looked at Magento 2 yet, don't know if they use something similar) – paskl Jul 19 '19 at 14:09
  • Have you take a look here: [Database: Migrations](https://laravel.com/docs/5.8/migrations) – Shim-Sao Jul 19 '19 at 14:26

1 Answers1

0

The most simple DB solution for your app will be Opencart database schema

Take a look for their product structure enter image description here

mikrafizik
  • 349
  • 1
  • 10