-- config represents the application configuration. CREATE TABLE IF NOT EXISTS config ( polling_interval INTEGER NOT NULL DEFAULT 300 ); -- services represents the list of services mon will check. CREATE TABLE IF NOT EXISTS services ( id INTEGER PRIMARY KEY, name TEXT NOT NULL, url TEXT NOT NULL, headers TEXT, enabled BOOLEAN NOT NULL DEFAULT TRUE CHECK (enabled IN (0, 1)) ); -- service_status stores historical status checks. CREATE TABLE IF NOT EXISTS service_status ( id BLOB PRIMARY KEY NOT NULL UNIQUE, service_id INTEGER NOT NULL, duration INTEGER NOT NULL, http_status INTEGER NOT NULL, timestamp INTEGER NOT NULL DEFAULT (strftime('%s', 'now')) );