forums › forums › SQLyog › SQLyog: Bugs / Feature Requests › Automatic Foreign Key Naming
- This topic is empty.
-
AuthorPosts
-
-
June 18, 2009 at 6:52 am #11543garethwatsonMember
Hello,
Can I request a feature please. I would like to see SQLYog pick non-duplicate key names when setting up foreign-key relationships (indexes as well would be nice but my 1st requirement would be the relationships).
Right now if I let SQLYog name the key it will take form FK_
. I would prefer if it could do something like FK_ _ . Extending this idea, when a non-unique foreign-key name is found then suffix the name with a number:
FK_
_ _1 FK_
_ _2 FK_
_ _3 etc..
I do realise this is complete laziness on my part. But to be honest, these names are perfectly fine for me and my team. At least we know from the name which tables are involved all we need to work out is the columns being referenced each side. Usually the column information is obvious from the tables.
Now, the format for the names that I have illustrated would suit me fine but they won't suit everyone! So I would suggest the name formatting feature needs to be configurable.
So any chance this might get implemented?
Cheers,
Gareth.
-
June 18, 2009 at 7:56 am #29156peterlaursenParticipant
I think it will be difficult across sessions. But can't you leave it empty and the server will name the constraint? I will have to refresh my mind about it.
-
June 18, 2009 at 1:15 pm #29157garethwatsonMemberpeterlaursen wrote on Jun 18 2009, 08:56 AM:I think it will be difficult across sessions. But can't you leave it empty and the server will name the constraint? I will have to refresh my mind about it.
Its populated by default with the FK_
. Honestly, I have not tried blanking the field and seeing what happens. I will give it a go and let you know. As for it being difficult across sessions, I am unsure what that means. Are you saying that two people creating the same foriegn key with the same name at the same time?
Thanks for the reply,
Gareth.
-
June 19, 2009 at 5:02 pm #29158DonQuichoteMember
I can really recommend not being “lazy” and providing a name yourself. That name is then not dependent on the tool you use and consistent across servers (so your update / upgrade scripts will work consistently). I would not like SQLyog to be inconsistent with MySQL. If you do not give a name, MySQL provides one in a consistent fashion. I would not want that process hijacked by my database frontend.
-
-
AuthorPosts
- You must be logged in to reply to this topic.