ALTER TABLE iam_roles
    DROP CONSTRAINT iam_roles_service_id_fkey,
    ADD CONSTRAINT iam_roles_service_id_fkey FOREIGN KEY (service_id) REFERENCES services (id)
        ON UPDATE CASCADE;

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

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

ALTER TABLE publications
    DROP CONSTRAINT publications_iam_role_id_fkey,
    ADD CONSTRAINT publications_iam_role_id_fkey FOREIGN KEY (iam_role_id) REFERENCES iam_roles (id)
        ON UPDATE CASCADE;
