status/schema.sql

14 lines
393 B
MySQL
Raw Normal View History

2025-01-28 15:17:10 +01:00
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
);