ALTER TABLE users
  ADD COLUMN IF NOT EXISTS previous_last_seen_at TIMESTAMPTZ;

ALTER TABLE users
  ADD COLUMN IF NOT EXISTS previous_last_seen_ip TEXT NOT NULL DEFAULT '';

UPDATE users
SET
  previous_last_seen_at = last_seen_at,
  previous_last_seen_ip = last_seen_ip
WHERE previous_last_seen_at IS NULL
  AND last_seen_at IS NOT NULL;
