Welcome Guest, Not a member yet? Register   Sign In
Datamapper and ID field
#1

[eluser]gte451f[/eluser]
I think the Datamapper project is great! I'm hung up on one thing.

Why does it require EVERY table to have a auto increment pk of "ID"?

This seems wasteful for a common form of Parent -> Child relationships.

Consider the following One to One....

User
-------------
id
first_name
last_name

Employee (a type of user)
------------------------------
user_id
department


The Employee record descends from one User record and therefore the Employee->user_id value IS unique and can act as the PK.

Yet Datamapper doesn't play well with this arrangement. It forces me to add an "ID" field to the employee table.

Ack!


Messages In This Thread
Datamapper and ID field - by El Forum - 04-26-2012, 04:02 PM
Datamapper and ID field - by El Forum - 04-26-2012, 11:40 PM
Datamapper and ID field - by El Forum - 05-01-2012, 12:21 PM
Datamapper and ID field - by El Forum - 05-01-2012, 11:43 PM



Theme © iAndrew 2016 - Forum software by © MyBB