Answer the question
In order to leave comments, you need to log in
How to link five tables with repeating elements through Yii2 intermediate table?
Hello, please tell me how to solve this problem.
There are 5 tables in the database connected through an intermediate.
The relationship hierarchy is as follows:
auto->auto_model (one-to-many)
auto_model->auto_group (one-to-many)
auto_group ->auto_description (one-to-many)
auto_description-> auto_action (one-to-one)
auto_description -> auto_coast (one-to-one) Putting
all records into one table results in about 60,000 rows.
In order not to produce records of the same type, records are not used in the auto_group, auto_description and auto_action tables. That is, milestone models will have a group of "suspension elements" and each such group will have a description of "steering rack linkage" whose action is "replacement". Because of this, I can't link tables directly. Moreover, the connection breaks when auto_group -> auto_description is selected, because all occurrences of this group are selected from the auto_bind table, which may not match, for example - auto_model-> id = 3.
Cool question: how can I make the binding of YII models with minimal system resources?
If not - then tell me how to properly organize the database?
Answer the question
In order to leave comments, you need to log in
In order not to produce records of the same type, records are not used in the auto_group, auto_description and auto_action tables.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question