-- migrate:up
--
-- Tactical columns on domain.devices to land CSV-imported roster data that
-- has no permanent home yet. Superseded by PRD F3.10's full driver roster
-- in P3 (domain.drivers + domain.driver_assignments) — at that point these
-- columns get dropped after the data is migrated.

ALTER TABLE domain.devices
    ADD COLUMN IF NOT EXISTS driver_name      text,
    ADD COLUMN IF NOT EXISTS driver_phone     text,
    ADD COLUMN IF NOT EXISTS iccid            text,
    ADD COLUMN IF NOT EXISTS expiration_at    timestamptz,
    ADD COLUMN IF NOT EXISTS device_group     text,
    ADD COLUMN IF NOT EXISTS roster_synced_at timestamptz;

-- migrate:down

ALTER TABLE domain.devices
    DROP COLUMN IF EXISTS driver_name,
    DROP COLUMN IF EXISTS driver_phone,
    DROP COLUMN IF EXISTS iccid,
    DROP COLUMN IF EXISTS expiration_at,
    DROP COLUMN IF EXISTS device_group,
    DROP COLUMN IF EXISTS roster_synced_at;
