Use a separate app instance for migrations
This MR:
- Splits the app factory in three:
- One function to initialize the app only with the config
- One factory for the main app used for the api using wsgi
- One factory for the app only used for migrations, which has no side-effects
- Configures
package.json
to use the correct app for migration commands
Closes #694