-- Migration 016: Global Quality Filter Setting
-- Issue: #31
-- Date: 2026-03-23
-- Description: Add quality_filter_level to profiles for consistent data views

-- Add quality_filter_level column to profiles
ALTER TABLE profiles ADD COLUMN IF NOT EXISTS quality_filter_level VARCHAR(20) DEFAULT 'all';

COMMENT ON COLUMN profiles.quality_filter_level IS 'Global quality filter for all activity views: all, quality, very_good, excellent';

-- Create index for performance (if filtering becomes common)
CREATE INDEX IF NOT EXISTS idx_profiles_quality_filter ON profiles(quality_filter_level);

-- Migration tracking
DO $$
BEGIN
    RAISE NOTICE '✓ Migration 016: Added global quality filter setting';
    RAISE NOTICE '  - Added profiles.quality_filter_level column';
    RAISE NOTICE '  - Default: all (no filter)';
    RAISE NOTICE '  - Values: all, quality, very_good, excellent';
END $$;
