Support » Plugin: Edit Any Table » Unable to edit primary key field

  • Resolved abouttheinn

    (@abouttheinn)


    I have a simple table with a primary key on a unique text field. To my surprise, one of our users needed to change the value in this field, but in Edit Any Table it is not editable (the other fields are editable).

    This is a great plugin (thank you!), but it would be a big help if editing this field could be enabled.

    https://wordpress.org/plugins/edit-any-table/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author redeyedmonster

    (@redeyedmonster)

    Hi – it is unusual to change a primary key after it has been assigned. Edit-Any-Table requires a primary key to know which record to update or delete, changing the key will not work because Edit-Any-Table will no longer have a reference to the record to change. May I suggest that you make this text field a unique field rather than a primary key (if it is important that it is unique) and then create an auto incrementing primary key that Edit-Any-Table can use as the record reference. I hope this helps solve your issue.

    Thread Starter abouttheinn

    (@abouttheinn)

    Yes, I realize it is unusual. I’ve tried your solution of adding an A-I ID field as primary key to see if the user will be able to manage with that. I know it is better DB practice, but once we expose ID numbers to them, best practices may change…

    Thanks again for your plugin, and your reply.

    how to control the user privileges

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Unable to edit primary key field’ is closed to new replies.