Files
fitme3070.pt/database/migration_20260612_horario_hora_inicio_time.sql
T
2026-06-12 21:20:23 +01:00

10 lines
596 B
SQL

-- ─── horario.hora_inicio: varchar(15) → TIME (O3) ──────────────────────────
-- The column already holds time-of-day strings ("HH:MM") and the app reads it
-- with TIME_FORMAT(hora_inicio, '%H:%i'), so it's semantically a time. Storing
-- it as TIME makes ordering/comparison correct and matches hora_fim (already
-- TIME). Existing "HH:MM" values cast cleanly. If any non-time legacy value
-- exists this ALTER will fail under strict mode — fix that row, then re-run.
ALTER TABLE `horario`
MODIFY `hora_inicio` TIME NOT NULL;