sexy_migrations foreign keys fail when using :ref
Reported by Jarkko Laine | April 20th, 2007 @ 10:00 AM
For some reason sexy migrations fail when using the :ref functionality to create real foreign keys. The Ruby MySQL client just says there is a syntax error even there definitely isn't. The exactly same syntax works when copied to MySQL CLi client or CocoaMySQL.
The reason seems to be that the plugin tries to execute multiple commands within a single execute call. I'm not sure whether this should work or not, but anyways it bombs for me.
The fix for this is to move the foreign key declarations to the actual create table command instead of using separate alter table commands. My patch fixes this and has been tested to work in PostgreSQL 8.1 and MySQL 5.1.
Comments and changes to this ticket
-
Chris Wanstrath April 20th, 2007 @ 10:00 AM
- State changed from new to resolved
Sweet, thanks. http://require.errtheblog.com/plugins/changeset/189
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป