Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Automatic Foreign Key Naming

forums forums SQLyog SQLyog: Bugs / Feature Requests Automatic Foreign Key Naming

  • This topic is empty.
Viewing 3 reply threads
  • Author
    Posts
    • #11543
      garethwatson
      Member

      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.

    • #29156
      peterlaursen
      Participant

      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.

    • #29157
      garethwatson
      Member
      peterlaursen 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.

    • #29158
      DonQuichote
      Member

      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.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.