-- SPDX-License-Identifier: Apache-2.0
-- SPDX-License-Identifier: Unlicense

REMOVE FIELD price               ON TABLE vm_node;
REMOVE FIELD avail_vcpus         ON TABLE vm_node;
REMOVE FIELD avail_storage_mib   ON TABLE vm_node;
REMOVE FIELD avail_mem_mib       ON TABLE vm_node;
DEFINE FIELD offers              ON TABLE vm_node TYPE array<object> DEFAULT [];
DEFINE FIELD offers.*            ON TABLE vm_node TYPE object;
DEFINE FIELD offers.*.price      ON TABLE vm_node TYPE int;
DEFINE FIELD offers.*.vcpus      ON TABLE vm_node TYPE int;
DEFINE FIELD offers.*.memory_mib ON TABLE vm_node TYPE int;
DEFINE FIELD offers.*.disk_mib   ON TABLE vm_node TYPE int;
update vm_node SET offers=[];
UPDATE vm_node;
