I really did look thorugh the docs as well as my own posts, and this is probably simple but:
how do you add a field to a table and add the index and constraint all at the same time?
Here is what I tried:
ALTER TABLE finan_invoices ADD Contacts_ID INT( 9 ) UNSIGNED,
ADD INDEX ( Contacts_ID ),
ADD CONSTRAINT FOREIGN KEY(Contacts_ID) REFERENCES addr_contacts(ID) ON DELETE RESTRICT ON UPDATE CASCADE;
and it gives me error #1005 - Can't create table './cpm052/#sql-60e_f588.frm' (errno: 150)
Is my syntax off or is there some other problem here?
Thanks!