D
D
Danil2016-01-20 16:21:31
MySQL
Danil, 2016-01-20 16:21:31

How to organize folder/subfolder storage in mysql?

There is a brand. The brand has a product that is in folders. Folder nesting level can be any. How to store it properly?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sunrails, 2016-01-20
@sunrails

Google:

  • Adjacency List
  • materialized path
  • Nested Sets
  • Closure Table

D
Dmitry Belyaev, 2016-01-20
@bingo347

alternatively, a table for folders with fields:
id - primary key
brand_id - foreign key referring to the brand
parent_id - secondary key - id of the parent folder
+ other fields relevant for the folder

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question