Welcome Guest, Not a member yet? Register   Sign In
name rule for the tables primary id, plural or not?
#1

[eluser]searain[/eluser]
For example, in the zen cart.

The table definition for products is

http://www.zen-cart.com/wiki/index.php/Table_products

Table: products
Primary Key: products_id

Note:

The key is "products_id" Not "product_id"

Now

Here is Jay Tee's example for

http://ellislab.com/forums/viewthread/57514/#282983

Table: invoices
Primary Key: invoice_id

Note:

The key is "invoice_id" not "invoices_id"

Question:

So looks like when we name tables we use plural format. But when we name the primary id of that table, some times we use plural format, some times we don't. What is the best practice here?

I know it is a small issue and either way should be OK. I used to use plural format for the primary key (id) etc. like Zen Cart did. Once I did it years ago, I keep using the plural format for the primary key(id) to be consistent.

But now I am starting to write some projects on CI, I think if I should change my old habit, I should do it now.

Any advices?

Thanks!


Messages In This Thread
name rule for the tables primary id, plural or not? - by El Forum - 06-08-2009, 05:13 PM
name rule for the tables primary id, plural or not? - by El Forum - 06-08-2009, 05:45 PM
name rule for the tables primary id, plural or not? - by El Forum - 06-08-2009, 06:14 PM
name rule for the tables primary id, plural or not? - by El Forum - 06-08-2009, 06:52 PM
name rule for the tables primary id, plural or not? - by El Forum - 06-08-2009, 07:04 PM
name rule for the tables primary id, plural or not? - by El Forum - 06-08-2009, 08:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB