CREATE TABLE IF NOT EXISTS contact_points (
	id INTEGER PRIMARY KEY AUTOINCREMENT,
	name TEXT NOT NULL,
	type TEXT NOT NULL,
	type_config TEXT NOT NULL
);

CREATE TABLE IF NOT EXISTS alerts (
	id INTEGER PRIMARY KEY AUTOINCREMENT,
	contact_point_id INTEGER NOT NULL,
	name TEXT NOT NULL,
	condition TEXT NOT NULL,
	custom_message TEXT NOT NULL,
	trigger_interval INTEGER NOT NULL,
	last_status TEXT NOT NULL,
	last_status_at INTEGER NOT NULL,
	FOREIGN KEY (contact_point_id) REFERENCES contact_points (id)
);
