2 ms·
That's fair. I honestly did not think about foreign key column names when I was typing, so thanks for pointing it out. I'm always a fan of making foreign key
by bluefirebrand 4y ago
That's fair.
I honestly did not think about foreign key column names when I was typing, so thanks for pointing it out.
I'm always a fan of making foreign key column names more descriptive than just the table name. Widgets may have a user_id but it probably makes more sense to have an owner_id.
- henriquez 4y agoIt’s still a good practice to refer explicitly to the foreign reference in the column name, so in your example owner_user_id would be preferable to owner_id if the foreign key refers to a record in the user table.