def METHOD_NAME(*args, **kwargs):
    func = kwargs.pop('_func')
    ctx = click.get_current_context()
    all_plugins = ctx.parent.params['all_plugins']
    plugin = ctx.parent.params['plugin']
    if plugin:
        plugins = {plugin_engine.get_plugin(plugin)}
    elif all_plugins:
        plugins = set(plugin_engine.get_active_plugins().values())
    else:
        plugins = None
    if plugins is None:
        func(*args, **kwargs)
    else:
        PluginScriptDirectory.dir = os.path.join(current_app.root_path, 'core', 'plugins', 'alembic')
        alembic.command.ScriptDirectory = PluginScriptDirectory
        for plugin in plugins:
            if not os.path.exists(plugin.alembic_versions_path):
                click.secho(f"skipping plugin '{plugin.name}' (no migrations folder)", fg='cyan')
                continue
            click.secho(f"executing command for plugin '{plugin.name}'", fg='cyan', bold=True)
            with plugin.plugin_context():
                func(*args, **kwargs)