remove_legacy_tables_20261117.sql 1.4 KB

1234567891011121314151617181920212223242526272829
  1. -- ============================================================================
  2. -- 清理已下线遗留模块的数据库表(2026-11-17)
  3. --
  4. -- 下线范围:
  5. -- 1) module/knowledge(旧知识库)——已由 ai_knowledge_base / ai_document 取代;
  6. -- 2) module/attachment(旧对话附件)——已由 ai_message_attachment / 新 AI 附件链路取代;
  7. -- 3) 无任何代码引用的历史表:meta_raw_file / meta_raw_sheet / rag_index_status /
  8. -- rag_ws78431654_d1024。
  9. --
  10. -- 说明:
  11. -- - 执行前请确认没有外部旧客户端仍调用 /knowledge-bases 等已删除接口;
  12. -- - 本脚本只删表,不清理旧文档文件与旧附件文件(已随代码清理手工删除)。
  13. -- ============================================================================
  14. drop table if exists knowledge_base cascade;
  15. drop table if exists knowledge_doc cascade;
  16. drop table if exists knowledge_doc_download_log cascade;
  17. drop table if exists kb_vec_1_bge_m3_d1024 cascade;
  18. drop table if exists kb_vec_1_d1024 cascade;
  19. drop table if exists kb_vec_2117247642917994497_bge_m3_d1024 cascade;
  20. drop table if exists kb_vec_2117254846962286594_bge_m3_d1024 cascade;
  21. drop table if exists chat_attachment cascade;
  22. drop table if exists meta_raw_file cascade;
  23. drop table if exists meta_raw_sheet cascade;
  24. drop table if exists rag_index_status cascade;
  25. drop table if exists rag_ws78431654_d1024 cascade;