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

ALTER INDEX unique_authorized_field_id_iam_role_id
    RENAME TO authorized_field_subscriber_grants_authorized_field_id_environm;

ALTER TABLE authorized_field_subscriber_grants
    RENAME iam_role_id TO environment_id;
