我们从Python开源项目中,提取了以下5个代码示例,用于说明如何使用flask_migrate.MigrateCommand()。
def run(): """Run the CLI manager for the web application .. todo:: allow extension add options & commands, separate create and run part of function command for checking config """ manager = flask_script.Manager(create_app) manager.add_option('-c', '--config', dest='cfg_files', required=False, action='append', default=['DEFAULT']) manager.add_option('-v', '--version', action='version', version='{} v{}'.format(PROG_NAME, VERSION)) manager.add_command('db', flask_migrate.MigrateCommand) manager.add_command('db-create', DbCreateCommand) manager.add_command('repocheck', RepocheckCommand) manager.add_command('assign-role', AssignRoleCommand) manager.add_command('check-config', CheckConfigCommand) manager.run()
def init_app(self, app): self.app = app self.add_command('db', MigrateCommand) self.add_option('-e', '--env', dest='app_config', required=False)
def configure_manager(): Migrate(app, db) manager.add_command('db', MigrateCommand)
def configure_manager(): """ ????????????? """ Migrate(app, db) manager.add_command('db', MigrateCommand)