Closed yaronyg closed 8 years ago
This will go out as part of story 0
*Story_001
2 options here:
Option 1 is superior in terms of clearing out the app data, but then we have the problem to recreate the db - is there an easy way to restart app.js? However relaunching the app at this point might be ok for development purposes, as this button will be hidden from normal users.
Option 2 . Superior in terms of replication - changes. I'm sure there is a batch delete but just can't find the documentation on this procedure atm.
I probably would shy away from deleting all the docs because that leaves a ton of tomb stones so you really aren't in a clean state. And unfortunately PouchDB does not support purge yet.
So I think you want to destroy the db. That is going to require, I suspect, that you take the code from here to the end and put it into a function. Then inside that function you add a path for "/selfdestruct" that is associated with calling server.close (or is it server.destroy?) and then db.destroy() and then uses nextTick to call back into the function that you refactored the code into. Then at the very end of the file, you call that function.
11/9 - This is working but needs to be tested all up.
Is available when "IS_DEBUG" option is true