title: using flask-migrate with flask-script and application factory
body: <p>I'm building flask application and decided to try application factory approach this time, but got into trouble with flask-migrate and can't figure out simple solution.</p>
  
  <p>Please note that I want to pass config location as an option to the script</p>
  
  <p>manage.py:</p>
  
  <pre><code>manager = Manager(create_app)
  manager.add_option("-c", "--config", dest="config_module", required=False)
  </code></pre>
  
  <p>then i need to create migrate instance and add command to the manager:</p>
  
  <pre><code>with manager.app.app_context():
      migrate = Migrate(current_app, db)
      manager.add_command('db', MigrateCommand)
  </code></pre>
  
  <p>but app instance is not created yet, so it fails</p>
  
  <p>I know I can pass config in environment variable and create application before creating manager instance, but how to do it using manager options?</p>