- Bumped application version to 0.8.11 and updated database schema version. - Added new API features for training units, including filtering by club and assigned trainer. - Enhanced the TrainingPlanningPage with options to filter training units by club and assigned trainer, improving user experience. - Implemented lead trainer assignment functionality, allowing users to take lead on training units. - Updated changelog with new version details and changes.
12 lines
631 B
SQL
12 lines
631 B
SQL
-- Migration 038: Optionale verantwortliche Person pro Trainingstermin (Vertretung)
|
|
-- Für Vereins-/Trainerübersicht: COALESCE(tu.lead_trainer_profile_id, tg.trainer_id) = wirksamer Leitungstrainer.
|
|
|
|
ALTER TABLE training_units
|
|
ADD COLUMN IF NOT EXISTS lead_trainer_profile_id INT REFERENCES profiles(id) ON DELETE SET NULL;
|
|
|
|
COMMENT ON COLUMN training_units.lead_trainer_profile_id IS 'Vertretung / expliziter Leiter dieses Terms; NULL = Standard (Haupttrainer der Gruppe)';
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_training_units_lead_trainer
|
|
ON training_units(lead_trainer_profile_id)
|
|
WHERE lead_trainer_profile_id IS NOT NULL;
|