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

ALTER INDEX unique_event_stream_id_iam_role_id
    RENAME TO authorized_field_publisher_gr_event_stream_id_environment_i_key;

ALTER TABLE authorized_field_publisher_grants
    RENAME iam_role_id TO environment_id;
