Extra feature in foreign keys?

Mary Bonney's profile image Mary Bonney posted 8 years ago in Feature discussion Permalink

I recently converted a database from MyISAM to innoDB and consequently added many foreign keys. As I have an offline test database and an online one, I had to create each key offline and then do the same thing online. What I realised would be handy is if the foreign key section could produce the SQL code used to generate a key (similar to the database "create" code) which I could simply paste into the online database and run.

I eventually found the code online and created my own, changing the parameters each time, but this feature in Heidi would be handy.

kalvaro's profile image kalvaro posted 8 years ago Permalink

Do you mean the "alter table" tab?

Mary Bonney's profile image Mary Bonney posted 8 years ago Permalink

I didn't realise you could change to the ALTER CODE tab while still working in the FOREIGN KEYS tab (rather against expectation). But, as far as I can see, just clicking on the created FK doesn't show the create code, you have to appear to alter the FK to get something to appear in the ALTER CODE tab.

How about, by clicking on the FK (but not changing it), the code to create it could appear in the ALTER CODE tab?

ansgar's profile image ansgar posted 8 years ago Permalink

The ALTER code tab is meant to show what really will be fired as soon as you hit the "Save" button. So, it's a bad idea to mark something as modified just after clicking it.

You could grab the code in the CREATE code tab, paste it in a query tab, prepend it with an ALTER TABLE xyz ADD .. ADD .. or whatever.

Mary Bonney's profile image Mary Bonney posted 8 years ago Permalink

It's just that I saw the equivalent of the "create table code" for foreign keys in another MySQL front-end and thought it would a useful thing to have in HeidiSQL. But the other software isn't as good as Heidi so I shall just stick with the way things are and create my own code when I need to transfer FKs.

Please login to leave a reply, or register at first.