With Subsonic Migrations the command
CreateForeignKey(parenttable.GetColumn("Id"),
childtable.GetColumn("parentId"));
creates a Foreign key as expected. But If I try to remove this foreign key
in the down method with
DropForeignKey(parenttable.GetColumn("Id"), childtable.GetColumn("parentId"));
the generated command:
ALTER TABLE `child` DROP CONSTRAINT fk_parent_id_parentid;
fails for mysql, because the "CONSTRAINT" keyword is not supported as
discussed here: http://bugs.mysql.com/bug.php?id=3742
You have to write:
ALTER TABLE `child` DROP FOREIGN KEY fk_parent_id_parentid;
I created a patch which overrides the BuildForeignKeyDropStatement for MySQL
Original issue reported on code.google.com by j.steinblock@gmail.com on 30 Apr 2009 at 3:36
Original issue reported on code.google.com by
j.steinblock@gmail.com
on 30 Apr 2009 at 3:36Attachments: