xwp / stream

🗄️ Stream plugin for WordPress

Home Page:https://wordpress.org/plugins/stream/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create a separate API for handling DB update routines

fjarrett opened this issue · comments

Our current method for dealing with DB update routines is starting to get a little messy, and some migration routines that require Connectors already be registered are needing their own method outside of the main update() method just to be able to fire at the correct time.

Furthermore, we should be asking users to opt-in to these updates, rather than just automatically doing it on reactivation. This is always a good idea just so admins know when their DB is being altered. This step is even more critical for very large sites, so a snapshot can be taken beforehand.

To remedy this, we should create a separate API specifically for handling DB update routines and prompt users to take action when updates are required. Once the update is performed, or if there are no routines to run, then the stream_db option can be updated.

UPDATE REQUIRED MESSAGE
screen shot 2014-03-29 at 2 21 14 am

SUCCESS MESSAGE
screen shot 2014-03-29 at 2 23 42 am

@fjarrett It might be beyond the scope of this issue but what about having a export / import settings routine? This would just be a json dump of all the wp_stream array in options. Also is there a way for the user to remove all traces of stream from the database?

@c3mdigital Yeah that's a cool idea. And definitely should be a separate issue as this pertains only to routines we need to do after plugin updates.

@c3mdigital And yes, you can completely uninstall Stream including it's tables and all its options in the DB. That was done in #102 and #114.

@c3mdigital I'm getting an error when attempting to update the DB.

There was an error updating the Stream database. Please try again.

Based on our convo last week, I think this is because it's looking for an option named wp_stream_db instead of stream_db.