#422 (ok 3.1) PDF schema: option to display just the keys

PDF (11)

Sorry for the way this patch is presented lem9, but the rules on the proxy on the company are so dacronic that I couldn't for my life connect to the repository.

This patch gives the user the option, via a new global variable to choose if, when generating the PDF_SCHEMA, they will show all the fields on the tables, or only the keys.

By keys here, the code gets every key on the table, and get the name of the field it uses, for multi-field key, it gets the onw with sequence_index = 1;

The txt file is the patch to the pdf_schema.php file. I'm still trying to make the SVN work, if I find some way I will make a diff\patch

$cfg['ShowOnlyKeys']= default FALSE

If = TRUE than it shows only the keys, if FALSE, shows all fields


  • Samuel Sol Villar dos Santos

    Ok, finally managed to make this into a diff of the SVN :) long time fiddling with the proxy configs. So attached goes the .diff file.
    File Added: change_keys.diff

  • Marc Delisle

    Marc Delisle - 2008-09-28
    • assigned_to: nobody --> lem9
  • Marc Delisle

    Marc Delisle - 2008-09-28

    thanks for your patch. Could you rework it to address the following issues:

    1. Why do you show just the first sequence field of an index?
    2. Instead of a config variable, please add a new checkbox in the "Display PDF schema" dialog (db_operations.php)
    3. To fetch the indexes, please use our standard logic. Here is code that gets all columns from all indexes:

    require_once './libraries/Index.class.php';
    $indexes = PMA_Index::getFromTable($table, $db);
    $all_columns = array();
    foreach($indexes as $index) {
    $all_columns = array_merge($all_columns, array_flip(array_keys($index->getColumns())));

  • Samuel Sol Villar dos Santos

    1. Basically because I did not want to recover all the collumns in a multi-key. After playing with the print, I saw that if you made reference to a multi-key foreign index, it would draw the line on the Schema based on the first field, and since my idea was to show only those that would possible have a FK reference draw, I choosed that.
    2. Ok I will make the change.
    3. Oh, nice new class :) It is new to . right? I searched for it on the 2.X branch and it didn't exist, that's why I did it that way.

    Anyway, I'm making the changes now and will post another diff later.

  • Samuel Sol Villar dos Santos

    Ok Mate, there you go, made the changes you asked for :) Only problem, I don't have access to a linux machine right now, as everything on work here runs on windows, therefore I couldn´t use the shell script to add the new string (for the checkbox) to all the language files. I just added it to english-utf-8 so you could see the name I gave and what it is supposed to say (it can be changed if you don't think it is nice). The rest is working.
    File Added: change_keys_2.diff

  • Marc Delisle

    Marc Delisle - 2008-09-29

    Patch accepted and merged, thanks! I just fixed a small bug ($showkeys instead of $show_keys). Language strings added.

    P.S. you used my proposed code which fetches all columns in a multi-column key. Not sure if this can produce a problem.

    P.P.S. I invite you to produce other patches, we need manpower in the project!

  • Marc Delisle

    Marc Delisle - 2008-09-29
    • priority: 5 --> 1
    • summary: Change the appearance of the PDF_SCHEMA --> (ok 3.1) PDF schema: option to display just the keys
    • status: open --> open-accepted
  • Samuel Sol Villar dos Santos

    Thanks lem9, I used that code and didn't get me any problems, I tested it against 2 InnoDB databases I have and it works correctly, not any issue.

    I will try to work on some more patches in areas I think I can help, in a 2 weeks time frame I will have my home machine up and running (stupid movings) and will be able to dedicate more time to it.

    About getting all columns, I still think it would be more logical to only getting those with sequence=0, but I would like others opinions on the matter.

  • Marc Delisle

    Marc Delisle - 2008-11-28
    • status: open-accepted --> closed-accepted