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

Renaming Prefixes Of Tables

forums forums SQLyog SQLyog: Bugs / Feature Requests Renaming Prefixes Of Tables

  • This topic is empty.
Viewing 1 reply thread
  • Author
    Posts
    • #9462
      emmis
      Member

      Would be nice to have an 'automatic'-renaming-solution for table-names with fi. prefixes:

      projekt1_table1

      projekt1_table2

      projekt1_table3

      to

      projekt2_table1

      projekt2_table2

      projekt2_table3

      … changing the part projekt1_ to projekt2_ with 1 click. Makes work easy sometimes

      Possible?

    • #20422
      peterlaursen
      Participant

      The problem is that you can't use wildcards in a RENAME SQL like

      Code:
      rename table `test2`.`p1%` to `test2`.`p2%`

      To support this you will then have to (for instance)

      1) enable mutible select in Object Browser (Ctrl+click and Shift+click). I think that is the easy part of if.

      2) next you will have to implement program code, reading the names of selected tables, validating those names against the mask/pattern provided by user and generating a RENAME statement for each selected table. Involves quite a lot of coding, I think.

      But for those people using MySQL at an ISP, where only one database is available the use of prefixes is widely used to compensate for this. So to those people such feature could be pretty useful. hmmm … not high priority in my opinion.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.