04-26-2012, 04:02 PM
[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!
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!