A
A
Alexander2016-09-28 15:20:18
MySQL
Alexander, 2016-09-28 15:20:18

Yii Setting up table linking. How to link paired tables?

Good afternoon.
I have 2 tables
post (id, title, shortstory)
post2 (id, postid, view, rating)
Previously, there was only one table, but it was necessary to divide the table into 2, in the first there is less updated data and a bunch of indexes, in the second there is only 1 index on postid with all sorts of counters.
How can I set up links in Mysql or something else so that you can use CActiveRecord as before, like $post->view, not through a relational link like $post->post2->view, because you have to edit the entire project.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question