CREATE TABLE host (
    id SERIAL PRIMARY KEY,
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
    name VARCHAR(255) NOT NULL UNIQUE
);

CREATE TABLE host_uptime (
    id SERIAL PRIMARY KEY,
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
    host_id INT NOT NULL REFERENCES host(id),
    -- uptime in seconds
    uptime INT NOT NULL
);

CREATE TABLE host_mem (
    id SERIAL PRIMARY KEY,
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
    host_id INT NOT NULL REFERENCES host(id),
    -- available memory in kB
    mem_avail INT NOT NULL
);