Make init db args cleaen
This commit is contained in:
@@ -421,7 +421,13 @@ if __name__ == "__main__":
|
|||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# 无参数时保持旧行为:重建 DB + 初始化默认数据
|
# 无参数时保持旧行为:重建 DB + 初始化默认数据
|
||||||
if not args.rebuild_db and not args.rebuild_vector_store and not args.skip_seed:
|
# 仅当完全未指定任何选项时才自动触发 rebuild-db。
|
||||||
|
if (
|
||||||
|
not args.rebuild_db
|
||||||
|
and not args.rebuild_vector_store
|
||||||
|
and not args.skip_seed
|
||||||
|
and not args.recreate_tool_db
|
||||||
|
):
|
||||||
args.rebuild_db = True
|
args.rebuild_db = True
|
||||||
|
|
||||||
ensure_db_dir()
|
ensure_db_dir()
|
||||||
@@ -430,6 +436,8 @@ if __name__ == "__main__":
|
|||||||
init_db()
|
init_db()
|
||||||
else:
|
else:
|
||||||
print("ℹ️ 跳过数据库结构变更(未指定 --rebuild-db)")
|
print("ℹ️ 跳过数据库结构变更(未指定 --rebuild-db)")
|
||||||
|
if not args.skip_seed or args.recreate_tool_db:
|
||||||
|
print("ℹ️ 当前将执行非破坏性流程(仅工具/默认数据初始化)")
|
||||||
|
|
||||||
if args.recreate_tool_db:
|
if args.recreate_tool_db:
|
||||||
init_default_tools(recreate=True)
|
init_default_tools(recreate=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user