2008年8月19日星期二

[fw-db] compound primary key

I'm starting a new project with ZF and have no prior experience with
Zend_Db_Table or the rest of Zend_Db.

I want to use a compound primary key in a table, ie:

CREATE TABLE images
(
image_id INT UNSIGNED NOT NULL PRIMARY KEY,
# ...
);

CREATE TABLE prints
(
image_id INT UNSIGNED NOT NULL, #FK
sequence INT UNSIGNED NOT NULL AUTO INCREMENT,
PRIMARY KEY (image_id, sequence)
# ...
);

Is this approach (compound PK) supported in Zend_Table_Db, and if so, how
does one declare the PK in a class def?

Also, in general, does using this compound key approach present other issues
with using Zend_Db down the road?

TIA,
David


--
View this message in context: http://www.nabble.com/compound-primary-key-tp19052927p19052927.html
Sent from the Zend DB mailing list archive at Nabble.com.

没有评论: