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   |
AJM
Messages: 2382 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.
|
|
|
 |
|
LIST3 linked from LIST1
By: rafs on Wed, 08 July 2015 19:08
|
 |
|
Re: LIST3 linked from LIST1
By: AJM on Thu, 09 July 2015 05:44
|
 |
|
Re: LIST3 linked from LIST1
By: rafs on Thu, 09 July 2015 16:17
|
 |
|
Re: LIST3 linked from LIST1
By: AJM on Fri, 10 July 2015 04:43
|
 |
|
Re: LIST3 linked from LIST1
By: rafs on Thu, 09 July 2015 16:55
|
 |
|
Re: LIST3 linked from LIST1
By: AJM on Fri, 10 July 2015 04:52
|
 |
|
Re: LIST3 linked from LIST1
By: rafs on Thu, 09 July 2015 18:10
|
 |
|
Re: LIST3 linked from LIST1
By: rafs on Thu, 09 July 2015 19:12
|
 |
|
Re: LIST3 linked from LIST1
By: AJM on Fri, 10 July 2015 05:01
|
 |
|
Re: LIST3 linked from LIST1
By: AJM on Fri, 10 July 2015 04:55
|
 |
|
Re: LIST3 linked from LIST1
By: rafs on Sat, 11 July 2015 18:19
|
 |
|
Re: LIST3 linked from LIST1
By: AJM on Sun, 12 July 2015 05:28
|
Goto Forum:
Current Time: Fri Jul 11 10:12:05 EDT 2025
Total time taken to generate the page: 0.10120 seconds
|