ALTER TABLE clients ADD personal_manager_id BIGINT REFERENCES users(id);
CREATE INDEX clients_personal_manager_id_ix ON clients (personal_manager_id);

UPDATE clients SET personal_manager_id = (
    SELECT TOP 1 user_id
    FROM personal_managers
    WHERE client_id = clients.id
);

DROP INDEX personal_managers.personal_managers_user_client_uniq;
DROP TABLE personal_managers;
