DEFINE TABLE account SCHEMAFULL; DEFINE FIELD balance ON TABLE account TYPE int DEFAULT 0; DEFINE FIELD tmp_locked ON TABLE account TYPE int DEFAULT 0; DEFINE FIELD escrow ON TABLE account TYPE int DEFAULT 0; DEFINE FIELD email ON TABLE account TYPE string DEFAULT ""; DEFINE TABLE vm_node SCHEMAFULL; DEFINE FIELD operator ON TABLE vm_node TYPE record; DEFINE FIELD country ON TABLE vm_node TYPE string; DEFINE FIELD region ON TABLE vm_node TYPE string; DEFINE FIELD city ON TABLE vm_node TYPE string; DEFINE FIELD ip ON TABLE vm_node TYPE string; DEFINE FIELD avail_mem_mb ON TABLE vm_node TYPE int; DEFINE FIELD avail_vcpus ON TABLE vm_node TYPE int; DEFINE FIELD avail_storage_gbs ON TABLE vm_node TYPE int; DEFINE FIELD avail_ipv4 ON TABLE vm_node TYPE int; DEFINE FIELD avail_ipv6 ON TABLE vm_node TYPE int; DEFINE FIELD avail_ports ON TABLE vm_node TYPE int; DEFINE FIELD max_ports_per_vm ON TABLE vm_node TYPE int; DEFINE FIELD price ON TABLE vm_node TYPE int; DEFINE FIELD offline_minutes ON TABLE vm_node TYPE int; DEFINE TABLE new_vm_req TYPE RELATION FROM account TO vm_node SCHEMAFULL; DEFINE FIELD hostname ON TABLE new_vm_req TYPE string; DEFINE FIELD extra_ports ON TABLE new_vm_req TYPE array; DEFINE FIELD public_ipv4 ON TABLE new_vm_req TYPE bool; DEFINE FIELD public_ipv6 ON TABLE new_vm_req TYPE bool; DEFINE FIELD disk_size_gb ON TABLE new_vm_req TYPE int; DEFINE FIELD vcpus ON TABLE new_vm_req TYPE int; DEFINE FIELD memory_mb ON TABLE new_vm_req TYPE int; DEFINE FIELD dtrfs_sha ON TABLE new_vm_req TYPE string; DEFINE FIELD dtrfs_url ON TABLE new_vm_req TYPE string; DEFINE FIELD kernel_sha ON TABLE new_vm_req TYPE string; DEFINE FIELD kernel_url ON TABLE new_vm_req TYPE string; DEFINE FIELD created_at ON TABLE new_vm_req TYPE datetime; DEFINE FIELD updated_at ON TABLE new_vm_req TYPE datetime; DEFINE FIELD price_per_unit ON TABLE new_vm_req TYPE int; DEFINE FIELD locked_nano ON TABLE new_vm_req TYPE int; DEFINE TABLE active_vm TYPE RELATION FROM account TO vm_node SCHEMAFULL; DEFINE FIELD hostname ON TABLE active_vm TYPE string; DEFINE FIELD mapped_ports ON TABLE active_vm TYPE array<[int, int]>; DEFINE FIELD public_ipv4 ON TABLE active_vm TYPE string; DEFINE FIELD public_ipv6 ON TABLE active_vm TYPE string; DEFINE FIELD disk_size_gb ON TABLE active_vm TYPE int; DEFINE FIELD vcpus ON TABLE active_vm TYPE int; DEFINE FIELD memory_mb ON TABLE active_vm TYPE int; DEFINE FIELD dtrfs_sha ON TABLE active_vm TYPE string; DEFINE FIELD kernel_sha ON TABLE active_vm TYPE string; DEFINE FIELD created_at ON TABLE active_vm TYPE datetime; DEFINE FIELD price_per_unit ON TABLE active_vm TYPE int; DEFINE FIELD locked_nano ON TABLE active_vm TYPE int; DEFINE FIELD collected_at ON TABLE active_vm TYPE datetime; DEFINE TABLE update_vm_req TYPE RELATION FROM account TO vm_node SCHEMAFULL; DEFINE FIELD vcpus ON TABLE update_vm_req TYPE int; DEFINE FIELD memory_mb ON TABLE update_vm_req TYPE int; DEFINE FIELD disk_size_gb ON TABLE update_vm_req TYPE int; DEFINE FIELD dtrfs_sha ON TABLE update_vm_req TYPE string; DEFINE FIELD dtrfs_url ON TABLE update_vm_req TYPE string; DEFINE FIELD kernel_sha ON TABLE update_vm_req TYPE string; DEFINE FIELD kernel_url ON TABLE update_vm_req TYPE string; DEFINE TABLE deleted_vm TYPE RELATION FROM account TO vm_node SCHEMAFULL; DEFINE FIELD hostname ON TABLE deleted_vm TYPE string; DEFINE FIELD mapped_ports ON TABLE deleted_vm TYPE array<[int, int]>; DEFINE FIELD public_ipv4 ON TABLE deleted_vm TYPE string; DEFINE FIELD public_ipv6 ON TABLE deleted_vm TYPE string; DEFINE FIELD disk_size_gb ON TABLE deleted_vm TYPE int; DEFINE FIELD vcpus ON TABLE deleted_vm TYPE int; DEFINE FIELD memory_mb ON TABLE deleted_vm TYPE int; DEFINE FIELD dtrfs_sha ON TABLE deleted_vm TYPE string; DEFINE FIELD kernel_sha ON TABLE deleted_vm TYPE string; DEFINE FIELD created_at ON TABLE deleted_vm TYPE datetime; DEFINE FIELD deleted_at ON TABLE deleted_vm TYPE datetime; DEFINE FIELD price_per_unit ON TABLE deleted_vm TYPE int; DEFINE TABLE app_node SCHEMAFULL; DEFINE FIELD operator ON TABLE app_node TYPE record; DEFINE FIELD country ON TABLE app_node TYPE string; DEFINE FIELD region ON TABLE app_node TYPE string; DEFINE FIELD city ON TABLE app_node TYPE string; DEFINE FIELD ip ON TABLE app_node TYPE string; DEFINE FIELD avail_mem_mb ON TABLE app_node TYPE int; DEFINE FIELD avail_vcpus ON TABLE app_node TYPE int; DEFINE FIELD avail_storage_gbs ON TABLE app_node TYPE int; DEFINE FIELD avail_ports ON TABLE app_node TYPE int; DEFINE FIELD max_ports_per_app ON TABLE app_node TYPE int; DEFINE FIELD price ON TABLE app_node TYPE int; DEFINE FIELD offline_minutes ON TABLE app_node TYPE int; DEFINE TABLE active_app TYPE RELATION FROM account TO app_node SCHEMAFULL; DEFINE FIELD app_name ON TABLE active_app TYPE string; DEFINE FIELD mapped_ports ON TABLE active_app TYPE array<[int, int]>; DEFINE FIELD host_ipv4 ON TABLE active_app TYPE string; DEFINE FIELD vcpus ON TABLE active_app TYPE int; DEFINE FIELD memory_mb ON TABLE active_app TYPE int; DEFINE FIELD disk_size_gb ON TABLE active_app TYPE int; DEFINE FIELD created_at ON TABLE active_app TYPE datetime; DEFINE FIELD price_per_unit ON TABLE active_app TYPE int; DEFINE FIELD locked_nano ON TABLE active_app TYPE int; DEFINE FIELD collected_at ON TABLE active_app TYPE datetime; DEFINE FIELD mr_enclave ON TABLE active_app TYPE string; DEFINE FIELD package_url ON TABLE active_app TYPE string; DEFINE FIELD hratls_pubkey ON TABLE active_app TYPE string; DEFINE TABLE deleted_app TYPE RELATION FROM account TO app_node SCHEMAFULL; DEFINE FIELD app_name ON TABLE deleted_app TYPE string; DEFINE FIELD mapped_ports ON TABLE deleted_app TYPE array<[int, int]>; DEFINE FIELD host_ipv4 ON TABLE deleted_app TYPE string; DEFINE FIELD vcpus ON TABLE deleted_app TYPE int; DEFINE FIELD memory_mb ON TABLE deleted_app TYPE int; DEFINE FIELD disk_size_gb ON TABLE deleted_app TYPE int; DEFINE FIELD created_at ON TABLE deleted_app TYPE datetime; DEFINE FIELD deleted_at ON TABLE deleted_app TYPE datetime; DEFINE FIELD price_per_unit ON TABLE deleted_app TYPE int; DEFINE FIELD locked_nano ON TABLE deleted_app TYPE int; DEFINE FIELD collected_at ON TABLE deleted_app TYPE datetime; DEFINE FIELD mr_enclave ON TABLE deleted_app TYPE string; DEFINE FIELD package_url ON TABLE deleted_app TYPE string; DEFINE FIELD hratls_pubkey ON TABLE deleted_app TYPE string; DEFINE TABLE ban TYPE RELATION FROM account TO account; DEFINE FIELD created_at ON TABLE ban TYPE datetime; DEFINE TABLE kick TYPE RELATION FROM account TO account; DEFINE FIELD created_at ON TABLE kick TYPE datetime; DEFINE FIELD reason ON TABLE kick TYPE string; DEFINE FIELD contract ON TABLE kick TYPE record; DEFINE TABLE report TYPE RELATION FROM account TO vm_node|app_node; DEFINE FIELD created_at ON TABLE report TYPE datetime; DEFINE FIELD reason ON TABLE report TYPE string;