The question is simple (and maybe silly):

When I create the tables in Postgres, do I have to also create the relations? I ask this because I have used an orm before and had issues with some relations, specially multiple primary keys, so I had to re-do all the db structure with the orm.

I was thinking about having only tables without relations and using cake's $hasMany, $belongsTo variables to manage the relations. will this work?

Thanks in advance.

有帮助吗?

解决方案

CakePHP's $hasMany and $belongsTo are accessing the database's relationships. So you have to create them.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top