fleet-platform/db/migrations/20260601000020_normalize_assigned_city.sql
kianiadee de34103f18
Some checks are pending
build / lint-test (push) Waiting to run
build / build-push (push) Blocked by required conditions
UI tweaks + city case fix
- Migration 20: collapse `Nairobi`/`nairobi` in domain.vehicles → 'nairobi'
- Remove the SLO panel from the top band (filter + tile rows stay)
- Offline vehicles render as solid grey instead of dim-cost-centre tint;
  opacity now only differentiates moving (1.0) vs parked (0.75) vs
  offline (0.55) so colour carries identity + state cleanly
2026-05-27 22:07:03 +03:00

16 lines
617 B
SQL

-- migrate:up
--
-- Data hygiene: 1 vehicle had `assigned_city = 'Nairobi'` while the other
-- 54 had `'nairobi'`. Collapse to lower-case so the filter dropdown shows
-- a single canonical option. The projector doesn't set assigned_city (it
-- comes from manual edits / roster imports) so no other code change is
-- needed to prevent recurrence.
UPDATE domain.vehicles
SET assigned_city = trim(lower(assigned_city)),
updated_at = now()
WHERE assigned_city IS NOT NULL
AND assigned_city != trim(lower(assigned_city));
-- migrate:down
-- No-op: re-introducing inconsistent casing would be a regression.