New FK not created with name

bmoore86bmoore86 Posts: 2
edited June 22, 2016 8:49AM in MySQL Compare
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;

Thanks!

Comments

  • Eddie DEddie D Posts: 1,807 Rose Gold 5
    Hi
    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
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
  • Eddie DEddie D Posts: 1,807 Rose Gold 5
    Hi

    Believe this bug is now fixed in MySQL Compare v1.0.0.672 which can be downloaded using this LINK.

    Many thanks
    Eddie
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
Sign In or Register to comment.