forked from uakfdotb/pybearmon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sql
7 lines (6 loc) · 901 Bytes
/
install.sql
1
2
3
4
5
6
7
-- front-end tables
CREATE TABLE checks (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, name VARCHAR(64) NOT NULL, type VARCHAR(32) NOT NULL, data VARCHAR(512) NOT NULL, check_interval INT NOT NULL DEFAULT 60, status ENUM ('online', 'offline') DEFAULT 'online', last_checked TIMESTAMP DEFAULT '2010-01-01 00:00:00', confirmations INT NOT NULL DEFAULT 0, `lock` VARCHAR(16) NOT NULL DEFAULT '', last_locked TIMESTAMP DEFAULT '2010-01-01 00:00:00');
CREATE TABLE contacts (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, type VARCHAR(32) NOT NULL, data VARCHAR(512));
CREATE TABLE alerts (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, check_id INT NOT NULL, contact_id INT NOT NULL, type ENUM ('up', 'down', 'both') DEFAULT 'both');
-- data tables
CREATE TABLE check_events (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, check_id INT NOT NULL, type ENUM ('up', 'down'), time TIMESTAMP DEFAULT CURRENT_TIMESTAMP);