-- hosts: physical or virtual machines belonging to a network. -- The ip field must fall within the CIDR of the parent network -- (enforced in application code, not at the DB level). CREATE TABLE IF NOT EXISTS hosts ( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, ip TEXT NOT NULL, network_id INTEGER NOT NULL REFERENCES networks(id) ON DELETE CASCADE );