Dependency to self and db specific naming rules

Question a): Is it possible to declare a dependency to self? Eg. for model Foo, there's the id field (primary key) and another field named belongsTo that is a reference to another row (id field) of the same table in the db. Is it possible to declare such a relation in the [tt]relations()[/tt] function of the model?

Question B): Is there a naming scheme for the db tables and their fields? Eg. should the primary key in each table named by ‘id’, or is there another rule for naming fields of a joining table in a MANY_MANY relation?

a). yes, self-join is supported.

B). no. You just need to declare them in your SQLs and Yii will identify them automatically.

Quote

a). yes, self-join is supported.

OK, an example maybe…? :)

You can find one under /tests/unit/framework/db/ar/

OK, thanks, I'll take a look.