[wp-trac] [WordPress Trac] #22884: What if I delete wp_posts table from database.

WordPress Trac noreply at wordpress.org
Sat Jan 24 22:49:04 UTC 2015

#22884: What if I delete wp_posts table from database.
 Reporter:  mukkundthanki            |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Database                 |     Version:  3.5
 Severity:  normal                   |  Resolution:
 Keywords:  needs-testing has-patch  |     Focuses:

Comment (by pento):

 I love [attachment:22884-handle_error-2.diff] for the insanity/audacity of
 silently rebuilding tables on the fly. :-)

 That said, I don't think this is quite the right way to handle it. It
 seems like there would be significant cases where we don't want to rebuild
 tables automatically.

 * If `wp_posts` disappears, do we really want to create a new table
 without giving the chance to restore a backup? This won't help the front
 end of the site - a database error vs. no content is not really a useful
 fix. It may hinder in some ways - an uptime monitoring script will
 probably notice the DB error, but will possibly miss having no content.
 * If `wp_users` disappears, we can't create an empty users table without
 prompting the admin to re-create their admin account.
 * If `wp_options` disappears, we'd be resetting all the site options if we
 recreated it, which would also include disabling security or custom login
 plugins the user may have installed.

 Now, I'm wondering if there's a place for only doing this check in `wp-
 admin`, and modifying `maint/repair.php` to handle missing tables. Losing
 tables is a pretty significant (and hopefully rare!) occurrence, I think
 we can afford to put an extra hurdle into repairing the situation.

Ticket URL: <https://core.trac.wordpress.org/ticket/22884#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list