ALTER TABLE authorized_field_subscriber_grants
    RENAME environment_id TO iam_role_id;

ALTER INDEX authorized_field_subscriber_grants_authorized_field_id_environm
    RENAME TO unique_authorized_field_id_iam_role_id;

ALTER TABLE authorized_field_subscriber_grants
    DROP CONSTRAINT authorized_field_subscriber_grants_environment_id_fkey,
    ADD CONSTRAINT authorized_field_subscriber_grants_iam_role_id_fkey FOREIGN KEY (iam_role_id) REFERENCES iam_roles (id)
        ON UPDATE CASCADE
        ON DELETE CASCADE;
