Hi everyone,

I started using Doctrine some days ago and realized that the way I was using
tables was simply not possible ...

I have always use an integer as auto_increment and do a primary key composed
by multiple fields such as (with MySQL)

CREATE TABLE user(
     id INTEGER(10) not null auto_increment,
     firstName VARCHAR(32),
     lastName VARCHAR(32),
     KEY(id),
     PRIMARY KEY(firstName,lastName)
)

and ... I could not replicate that with Doctrine, which would ask me to have
the id as a primary key ...
So I went to Doctrine IRC for a little chat, and ... some guy told me that I
was completely misunderstanding how a RDBMS worked ...

I am no expert in SQL but ... this is how all the tables are done in
OSCommerce...

So my questions are :
1- Am I really not using SQL tables as It should be?
2- Otherwise, how do you replicate that in Doctrine ?

Regards,

Jean-Baptiste

ps:
I always thought that this was the best way for the following reason :
- the id is just an integer, so better performance for joins, and searching
for a known user
- the primary key is used to prevent duplicates and when searching
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/Show-Participation

Reply via email to