I have two tables that look like the following:
I am then trying to add a foreign key constraint like so:
mysql> ALTER TABLE `Order`
-> ADD CONSTRAINT `FK_baseline_order`
-> FOREIGN KEY `baselineId`
-> REFERENCES `Baseline` (`id`)
-> ON UPDATE CASCADE ON DELETE CASCADE;
I get the following "syntax" error:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'REFERENCES
Baseline(id) ON UPDATE CASCADE ON DELETE CASCADE' at line 4
I for the life of me can't figure out what I'm doing wrong. I feel like I'm missing something really obvious here...