Long time ago I preferred simple column names like project for foreign key columns. When you use the SQL console of the DBMS it’s obvious that these are FKs and easy to understand. This is how our SQL schema looks now. Unfortunately it proved to be not that good for coding:
Sometimes this causes confusion because the getter method of DB objects for the FK column value and the related object is the same.
Then with DBIC you need to call $object->get_column('project') to get the actual FK column value instead of the related project object.
We should rename all FK columns in a special Git commit and DB migration from foo to foo_id.
Long time ago I preferred simple column names like
project
for foreign key columns. When you use the SQL console of the DBMS it’s obvious that these are FKs and easy to understand. This is how our SQL schema looks now. Unfortunately it proved to be not that good for coding:$object->get_column('project')
to get the actual FK column value instead of the related project object.We should rename all FK columns in a special Git commit and DB migration from
foo
tofoo_id
.