19 lines
1.0 KiB
SQL
19 lines
1.0 KiB
SQL
-- ============================================================================
|
|
-- MIGRATION : Ajout de la colonne composition_train (JSONB) dans la table horaires
|
|
-- Date : 2026-03-01
|
|
-- Description : Stocke la composition complète et ordonnée des matériels roulants
|
|
-- affectés à un horaire (sillon). Chaque élément contient l'id,
|
|
-- le nom, le nom technique, l'URL de l'image et la position.
|
|
--
|
|
-- ⚠️ À EXÉCUTER dans l'éditeur SQL Supabase :
|
|
-- https://supabase.com/dashboard → votre projet → SQL Editor
|
|
-- ============================================================================
|
|
|
|
ALTER TABLE public.horaires
|
|
ADD COLUMN IF NOT EXISTS composition_train JSONB DEFAULT '[]'::jsonb;
|
|
|
|
COMMENT ON COLUMN public.horaires.composition_train IS
|
|
'Composition ordonnée du train : liste JSON des matériels roulants affectés au sillon. '
|
|
'Format : [{"materiel_id": 1, "materiel_nom": "Régiolis", "materiel_nom_technique": "X73500", "materiel_image_url": "https://...", "position": 1}, ...]';
|
|
|