Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » LIST3 linked from LIST1 (LIST3: As I scroll through the parents, or children, the grandchild does not change)
Re: LIST3 linked from LIST1 [message #4822 is a reply to message #4818] Fri, 10 July 2015 04:43 Go to previous messageGo to previous message
AJM is currently offline  AJM
Messages: 2348
Registered: April 2006
Location: Surrey, UK
Senior Member
rafs wrote on Thu, 09 July 2015 21:17

I am following the convention that every table's primary key is called 'id', and every table's foreign key is called <referenced-table>_id. This is the convention that I picked up from CakePHP, and probably RoR. This convention was a requirement for the project. So, for example, packages has many files (WHERE packages.id = files.package_id), and files have many lines (WHERE files.id = lines.file_id).

That may be a convention that some newbies with lesser experience follow, but the convention that I and my fellow developers have been following since the 1970s is that wherever possible the same column should have the same name regardless of which table it's on. All the SQL samples you see on any vendor's website still follow this convention, which is why you see "customer.customer_id" and not "customer.id". Note also the use of snake_case and not CamelCaps.


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to bulk import my users into Radicore?
Next Topic: How to change the screen title of a list1 task
Goto Forum:
  


Current Time: Sun May 05 07:15:52 EDT 2024

Total time taken to generate the page: 0.01064 seconds