V
V
Vlad Osadchyi2019-05-18 15:00:51
Yii
Vlad Osadchyi, 2019-05-18 15:00:51

Is it necessary to describe relationships in SQL between tables when using yii2?

Is it necessary to describe relationships in SQL between tables when using yii2? Or will it be enough to do it in the model itself, with hasOne()/hasMany ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2019-05-18
@VladOsadchyi

you need to
facilitate it yourself, this can be done by migrations in the framework, but you need to do them manually, but the syntax is lightweight.
If you take Symfony and Doctrine, then there is a command that checks models and configs from them (in annotations or yml files) and automatically generates SQL migrations with the right connections

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question