Friends,

I am designing a MySql DB schema that will use foreign
keys similar to:

create table orders(id int auto_increment primary key,
amount double(7,2) );

create table orderItems(id int, item char(20), price
double(5,2), quantity int, key(id), foreign key id
references orders (id));

I am currently not using a version that supports
foreign keys but hope to be in the future.  In the
meantime I'll need to implement the foreign key
constraints through my application.  My concern is
that if either of the tables get corrupted or out of
sync I won't be able to match up the order items with
the orders.

Is there anything that I might do to ensure that I'll
be able to recover if the tables get out of sync? 
I've thought of adding timestamp columns to each table
as an aid in matching up the records but am not sure
how helpful this would be or if it would be worth the
extra storage space.  Any comments about your
experience using foreign keys and MySql would be
appreciated.

--Michael



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to