Files
flowfish/backend/migrations/versions/006_add_analysis_timing_fields.sql
taylanbakircioglu d7ca50b387 feat: Flowfish - eBPF-powered multi-cluster Kubernetes observability platform
Multi-cluster dependency mapping, real-time network monitoring,
impact analysis, and CI/CD integration capabilities.

Made-with: Cursor
2026-03-29 21:43:20 +03:00

20 lines
809 B
SQL

-- Migration: Add started_at and stopped_at fields to analyses table
-- These fields are used by auto-stop monitor to track analysis execution time
-- Add started_at column (when analysis started running)
ALTER TABLE analyses
ADD COLUMN IF NOT EXISTS started_at TIMESTAMP NULL;
-- Add stopped_at column (when analysis stopped/completed/failed)
ALTER TABLE analyses
ADD COLUMN IF NOT EXISTS stopped_at TIMESTAMP NULL;
-- Create index for faster querying of running analyses
CREATE INDEX IF NOT EXISTS idx_analyses_started_at ON analyses(started_at)
WHERE status = 'running';
-- Comment on columns
COMMENT ON COLUMN analyses.started_at IS 'Timestamp when analysis started running (for auto-stop calculation)';
COMMENT ON COLUMN analyses.stopped_at IS 'Timestamp when analysis stopped/completed/failed';