• Resolved crispress

    (@crispress)


    I’ve digged around (with Adminer) in the database… It seems TB is saving it’s tables as common posts, so WP creates endless revision copies of it, everytime a table is changed.
    My ‘wordpressposts’ table has grown to 70 MB and I think TB is not entirely innocent. ??

    Could I delete all DB entries of type “revision” in ‘post_type’? I could narrow it down to tables only by additionally selecting the table’s title in ‘post_title’…
    But I’m not sure if I can really do that, because if I do a change in the table, THAT change appears immediately as a revision item in the DB. So it looks like the last revision is the current post/table?

    Maybe there could be a “Purge Revisions” button in the editor?
    And since there doesn’t seem to be a way to go back to any of the revisions anyway, it shouldn’t save revisions at all maybe. I guess that’s the WP revision function and can’t be supressed(?), but then the Plugin could maybe automatically delete it’s table revisions, maybe at least once a day or so… ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    You are right, as TablePress uses the WordPress Custom Post Type system, this also creates a revision when a table is saved/edited.

    You can control this with the normal PHP constants mentioned on https://codex.www.ads-software.com/Revisions

    Deleting old revisions is also possible with a SQL query, and restricting it to TablePress table revisions is possible by including a WHERE clause that looks for the post_type value of tablepress_table.

    And while there is no directly visible user interface in TablePress to restore old revisions (this might come in the future), this is possible on the regular custom post type edit screens, which can be made visible with a small debug plugin. So, these revisions to have a use case and it makes sense to store at least some of them, for backup purposes.

    Regards,
    Tobias

    Thread Starter crispress

    (@crispress)

    Thanks, Tobias. The post_type is always “revision” if it’s a revision of any other post type. I guess the relation of a revision to the actual post is made via post_parent or post_name (which is “<id>-revision-v1”).
    Half knowing (gef?hrliches Halbwissen am Start ?? ), I always try to avoid to manipulate the DB directly, if I can. So my workaround was to duplicate the tables and delete the originals, which also cleared all of it’s revisions.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Database growing with table revisions’ is closed to new replies.