474a5bee99
- Delete YOLO processor implementation (src/core/processor/yolo.rs) - Remove YOLO from processing pipeline and worker - Clean up YOLO-related code across multiple modules - Add migration 033_remove_yolo.sql YOLO functionality removed as part of architecture simplification
50 lines
1.7 KiB
PL/PgSQL
50 lines
1.7 KiB
PL/PgSQL
-- ================================================================
|
|
-- Migration 033: Remove YOLO from Pipeline
|
|
-- Date: 2026-08-30
|
|
-- Purpose: Remove all YOLO-related columns, data, and indexes
|
|
-- ================================================================
|
|
|
|
BEGIN;
|
|
|
|
-- 1. Remove YOLO data from tkg_nodes
|
|
DELETE FROM tkg_nodes WHERE node_type = 'yolo_object';
|
|
|
|
-- 2. Remove YOLO-related edges from tkg_edges
|
|
DELETE FROM tkg_edges
|
|
WHERE source_node_id IN (SELECT id FROM tkg_nodes WHERE node_type = 'yolo_object')
|
|
OR target_node_id IN (SELECT id FROM tkg_nodes WHERE node_type = 'yolo_object');
|
|
|
|
-- 3. Drop tkg_co_occurrence materialized view (contains YOLO placeholders)
|
|
DROP MATERIALIZED VIEW IF EXISTS tkg_co_occurrence CASCADE;
|
|
|
|
-- 4. Remove YOLO index from frames table
|
|
DROP INDEX IF EXISTS idx_frames_yolo_gin;
|
|
|
|
-- 5. Remove yolo_objects column from frames table
|
|
ALTER TABLE frames DROP COLUMN IF EXISTS yolo_objects;
|
|
|
|
-- 6. Remove YOLO processor from pre_chunks
|
|
DELETE FROM pre_chunks WHERE processor_type = 'yolo';
|
|
|
|
-- 7. Remove YOLO chunks (trace_yolo_* and visual type)
|
|
DELETE FROM chunks WHERE chunk_id LIKE 'trace_yolo_%';
|
|
DELETE FROM chunks WHERE chunk_type = 'visual';
|
|
|
|
-- 8. Remove YOLO from processor_versions
|
|
DELETE FROM processor_versions WHERE processor_name = 'yolo';
|
|
|
|
COMMIT;
|
|
|
|
-- ================================================================
|
|
-- Post-migration cleanup (run manually if needed)
|
|
-- ================================================================
|
|
|
|
-- Reindex after major deletion
|
|
-- REINDEX TABLE tkg_nodes;
|
|
-- REINDEX TABLE tkg_edges;
|
|
-- REINDEX TABLE frames;
|
|
|
|
-- Vacuum analyze
|
|
-- VACUUM ANALYZE tkg_nodes;
|
|
-- VACUUM ANALYZE tkg_edges;
|
|
-- VACUUM ANALYZE frames; |