INNER CODE UNIT · Python

remove

fastapi-practices/fba-slim · backend/cli.py:447

    async def remove() -> None:
        plugin_dir = PLUGIN_DIR / plugin
        if not plugin_dir.exists():
            raise cappa.Exit(f'插件 {plugin} 不存在', code=1)

        if not no_sql:
            destroy_sql_file = await get_plugin_destroy_sql(plugin, settings.DATABASE_TYPE, settings.DATABASE_PK_MODE)
            if destroy_sql_file:
                console.note(f'正在执行插件 {plugin} 销毁 SQL 脚本:{destroy_sql_file}')
                async with async_db_session.begin() as db:
                    await execute_destroy_sql_scripts(db, destroy_sql_file)
            else:
                console.warning(f'插件 {plugin} 未提供销毁 SQL 脚本,跳过数据库清理')

        console.note(f'正在卸载插件 {plugin} 依赖...')
        await uninstall_requirements_async(plugin)

        console.note(f'正在备份插件 {plugin}...')

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…