[Req] Adding "Options" field...

Help
ephestione
2011-06-10
2013-06-06
  • ephestione

    ephestione - 2011-06-10

    When I discovered Adminer, being used to the lagginess of my cpanel's phpmyadmin, I was like this:  :-))))

    There is one thing though that I was surprised not to find in the alter table dialogue, which is something like the "options" field (I hope I remember its name correctly) in phpmyadmin, where you can set predefined field options depending on the data type, for example:
    for timestamp "ON UPDATE CURRENT_TIMSTAMP" ON/OFF (which I noticed is set to "ON" by default, and you cannot remove unless you manually edit the sql command… unsexy :P)
    for integers "UNSIGNED" on/off
    and so on, hope you get what I mean!
    Other than this, thank you for a nifty piece of code ;)

     
  • ephestione

    ephestione - 2011-06-10

    Silly me… was writing by memory and ended up saying a stupid thing which I cannot edit anymore.
    The OPTIONS field is ALREADY there, of course including the UNSIGNED option for integers… my request was actually to enable (and populate) the options field for TIMESTAMP type values as well, maybe it's the late hour and the fact that I've been delving in PHP the whole afternoon :P

     
  • Jakub Vrána

    Jakub Vrána - 2011-06-11

    You can specify timestamp options in the Default values (there is a checkbox to display them), e.g. by CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP or just CURRENT_TIMESTAMP. I will consider changing it to the selectable option as with other data types.

     
  • ephestione

    ephestione - 2011-06-11

    Yup, I tried that too, but what's funny though, is that right after table creation, opening the Alter Table screen, in the "detault" field you can see just the "CURRENT_TIMESTAMP", even if actually that field behaves as "CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP".
    At least that's what I found by testing ;)
    Thank you for the consideration anyway!

     
  • Jakub Vrána

    Jakub Vrána - 2011-06-11

    Which MySQL version are you using? I believe that older MySQL version don't allow detecting the ON UPDATE state.

     
  • ephestione

    ephestione - 2011-06-11

    Oh I have MySQL 5 on my shared hosting, no problem on that :)
    I just checked to make sure anyway: I confirm that the sql command on table creation only sets the timestamp to not null, without adding anything to default value, yet the field behaves as if it was "current_timestamp on update current_timestamp"

    If I edit any field from the Select view, by double clicking its area and bringing up the textarea, then press press the save button, the timestamp field for that record is automatically updated. Instead if I press the edit link of the record, openng the record editing form, only the field that I change is saved, and the timestamp is not modified (?)

     
  • Jakub Vrána

    Jakub Vrána - 2011-06-13

    "current_timestamp on update current_timestamp" is default default value for the first timestamp column.

     
  • ephestione

    ephestione - 2011-06-13

    I see, so the defaillance lies in the fact that even if that is the default value, in the default field I only see "current_timestamp", so I cannot really change it ;)

     
  • Jakub Vrána

    Jakub Vrána - 2013-04-17

    I've added a UI for this in Git.

     
  • ephestione

    ephestione - 2013-04-17

    Thank you!

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks