ALTER TABLE authorized_field_publisher_grants
    RENAME environment_id TO iam_role_id;

ALTER INDEX authorized_field_publisher_gr_event_stream_id_environment_i_key
    RENAME TO unique_event_stream_id_iam_role_id;

ALTER TABLE authorized_field_publisher_grants
    DROP CONSTRAINT authorized_field_publisher_grants_environment_id_fkey,
    ADD CONSTRAINT authorized_field_publisher_grants_iam_role_id_fkey FOREIGN KEY (iam_role_id) REFERENCES iam_roles (id)
        ON UPDATE CASCADE
        ON DELETE CASCADE;
