giving the programcourses table a single primary key field

A place for users and developers of the Xataface to discuss and receive support.

Postby Scott » Mon Apr 09, 2007 7:42 am

in the "getting started example", the programcourses table has a primary key consisting of programcourses.programid WITH programcourses.courseid.

thats ok. but often in a dbschema, tables similar to programcourses will need to be a given a 'programcoursesid' which should be the primary key to uniquely identify programcourses records in possible other relationships with more tables inside the schema (generally programcourses would get extra fields added in that case too).

without checking the php's first, i tried and made a primary key for programcourses (called programcoursesid) and set the programcourses.programid+programcourses.courseid to be a "UNIQUE" pair (instead of the primary key).
i did not get the expected result :D

how would i solve a scenario like this? ; where a linktable like programcourses needs to be used itself in a relationship (and thus needs a primary key id field so it can be used as foreign key).

Scott.
Scott
 
Posts: 30
Joined: Wed Dec 31, 1969 5:00 pm

Postby Scott » Mon Apr 09, 2007 8:41 am

oops it DOES seem to work fine. i just forgot to make the programcoursesid an autoincrement field DOH!

i DID change the primary key staus of programcourses.programid + programcourses.courseid into UNIQUE instead of primary key.
will dataface be able to handle that change without any adverse side-effects?
Scott
 
Posts: 30
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 40 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved