Command line task support, and the first task: apostrophe:migrate. Just call apos.task() before invoking listen() and, if it returns true, don't invoke listen(). Apostrophe takes care of the rest. The apostrophe:migrate task makes any necessary updates to the database structure. Migrations should be safe to run and you should make this task part of your deployment process. Naturally you should be backing up your site with frequency and enthusiasm.

TODO: offer a way to add listeners to individual tasks.