Thread: Storing prices
View Single Post
Old 11-08-2012, 10:21 PM   PM User | #25
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,185
Thanks: 59
Thanked 3,995 Times in 3,964 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
There's no "ALTER CONSTRAINT" command, so you just have to do:
Code:
ALTER TABLE DROP FOREIGN KEY nameyougaveit;

ALTER TABLE ADD CONSTRAINT FOREIGN KEY name ...same as in create...
Simple, really.

This, too, is documented:
http://dev.mysql.com/doc/refman/5.5/en/alter-table.html
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote