New FK not created with name

Compares and synchronizes MySQL database schemas.

New FK not created with name

Postby bmoore86 » Fri Dec 20, 2013 8:40 pm

Have an issue where source has FK but target does not.
Am getting a working ALTER TABLE statement, but the ALTER does not include the FK name, which means I get whatever MySQL wants to generate for me.

Don't really like this. Would prefer that the newly created FK have the same name as my Source.

Is there any way to do this??

Here's what MySQL Compare gives me:
ALTER TABLE `acquisition` ADD FOREIGN KEY (`character_id`) REFERENCES `player_character` (`character_id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

What I would prefer:
ALTER TABLE `acquisition` ADD CONSTRAINT `fk_player_character_to_acquisition` FOREIGN KEY (`character_id`) REFERENCES `player_character` (`character_id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

Posts: 1
Joined: Fri Dec 20, 2013 8:15 pm
Location: United States

Postby eddie davis » Mon Dec 23, 2013 2:27 pm

Thank you for your forum post.

I suspect that MySQL Compare has read the information from the metadata within a system file and created the ALTER TABLE statement in the format you do not like.

I have submitted a Bug Report for the Development Ream to consider, the Bug Report reference is MSC-67. Also a Support Ticket has been created for you HERE, call reference #10162.

I will update this post when I receive further information.

Many Thanks
Eddie Davis
Technical Support Engineer
Red Gate Software Ltd
eddie davis
Posts: 1069
Joined: Wed Jun 14, 2006 2:47 pm
Location: Red Gate Software

Return to MySQL Compare

Who is online

Users browsing this forum: No registered users and 0 guests