Welcome Guest, Not a member yet? Register   Sign In
Question about Database
#3

[eluser]slowgary[/eluser]
Do you really want to give your users the primary key of your tables as their user id? Seems like a bad choice. What if you decide to alter your schema? Also, is your first user going to have an id of 1??

Additionally, I'm not sure there's a reliable way to 'alternate' IDs between tables or that it's even a good idea. I really think you might end up with a serious mess on your hands in the long run.

If 'experts' and 'employers' are both 'users', why not just have 1 table for 'users' and add a field for 'user_type', which can be enumerated as 'experts', 'employers'? This way you don't have to worry about managing the primary key. Also, if you're looking for a friendly ID to be able to give the user, you should just allow them to choose their own alphanumeric username. I think UUIDs are actually 36 characters as a string, but if you choose to give your users a numeric ID, you'll need to give them a very large number to assure that you don't run out of numbers. A number like '234509567759' is not as friendly as a username like 'happyharry'.


Messages In This Thread
Question about Database - by El Forum - 06-20-2009, 09:40 PM
Question about Database - by El Forum - 06-20-2009, 10:09 PM
Question about Database - by El Forum - 06-20-2009, 11:01 PM
Question about Database - by El Forum - 06-21-2009, 01:44 AM
Question about Database - by El Forum - 06-21-2009, 08:08 AM
Question about Database - by El Forum - 06-21-2009, 08:17 AM
Question about Database - by El Forum - 06-21-2009, 11:06 AM
Question about Database - by El Forum - 06-21-2009, 01:23 PM
Question about Database - by El Forum - 06-22-2009, 01:16 AM
Question about Database - by El Forum - 06-22-2009, 01:42 AM
Question about Database - by El Forum - 06-22-2009, 03:01 AM
Question about Database - by El Forum - 06-22-2009, 04:10 AM
Question about Database - by El Forum - 06-22-2009, 07:37 AM
Question about Database - by El Forum - 06-22-2009, 07:57 AM
Question about Database - by El Forum - 06-22-2009, 08:15 AM
Question about Database - by El Forum - 06-22-2009, 08:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB