-- Migration 006: Training Types - Abilities Mapping
-- Add abilities JSONB column for future AI analysis
-- Maps to: koordinativ, konditionell, kognitiv, psychisch, taktisch
-- Created: 2026-03-21

-- ========================================
-- Add abilities column
-- ========================================
ALTER TABLE training_types
  ADD COLUMN IF NOT EXISTS abilities JSONB DEFAULT '{}';

-- ========================================
-- Add description columns for better documentation
-- ========================================
ALTER TABLE training_types
  ADD COLUMN IF NOT EXISTS description_de TEXT,
  ADD COLUMN IF NOT EXISTS description_en TEXT;

-- ========================================
-- Add index for abilities queries
-- ========================================
CREATE INDEX IF NOT EXISTS idx_training_types_abilities ON training_types USING GIN (abilities);

-- ========================================
-- Comment
-- ========================================
COMMENT ON COLUMN training_types.abilities IS 'JSONB: Maps to athletic abilities for AI analysis (koordinativ, konditionell, kognitiv, psychisch, taktisch)';
COMMENT ON COLUMN training_types.description_de IS 'German description for admin UI and AI context';
COMMENT ON COLUMN training_types.description_en IS 'English description for admin UI and AI context';
