Database tables foreign key error
Permalink
I'm trying to create several database tables in a db.xml file. However I keep getting an error related to the foreign key constraints.
This is what I have:
I keep getting an error that says the syntax is wrong.
mysql error: [1064: 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 'foreign key(group_id) references BuilderGroup(id)' at line 2] in EXECUTE("ALTER TABLE Price MODIFY COLUMN group_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT , foreign key(group_id) references BuilderGroup(id) ")
What am I doing wrong?
This is what I have:
I keep getting an error that says the syntax is wrong.
mysql error: [1064: 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 'foreign key(group_id) references BuilderGroup(id)' at line 2] in EXECUTE("ALTER TABLE Price MODIFY COLUMN group_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT , foreign key(group_id) references BuilderGroup(id) ")
What am I doing wrong?