17 lines
617 B
MySQL
17 lines
617 B
MySQL
|
|
-- 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.
|