ALTER TABLE users ADD COLUMN last_seen timestamp with time zone NULL;
UPDATE users SET last_seen=TO_TIMESTAMP(lastmessage::double precision / 1000);
