ALTER TABLE nodes ADD COLUMN IF NOT EXISTS previous_environment TEXT REFERENCES statuses(name) ON UPDATE CASCADE ON DELETE SET NULL;