This repository was archived by the owner on Mar 23, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsql.go
More file actions
55 lines (49 loc) · 1.52 KB
/
sql.go
File metadata and controls
55 lines (49 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package main
const initialTables = `-- Initial tables
-- Scouts table.
create table if not exists scouts (
hostname text unique not null primary key,
port smallint not null default 443,
-- interval in seconds
interval integer not null default 60,
-- last check time
last_check timestamp not null default current_timestamp,
-- First failure time
failed timestamp not null default current_timestamp - interval '1 year',
-- last check status
status smallint not null default 0,
-- assignee who acknowledged the error
assignee text not null default '',
-- time of acknowledgement
assigned timestamp not null default current_timestamp
);
-- Canaries table.
create table if not exists canaries (
name text unique not null primary key,
-- interval in seconds
interval integer not null default 60,
-- last check time
last_check timestamp not null default current_timestamp,
-- First failure time (or time when the system started noticing, anyway)
failed timestamp not null default current_timestamp - interval '1 year',
-- last check status
status smallint not null default 0,
-- assignee who acknowledged the error
assignee text not null default '',
-- time of acknowledgement
assigned timestamp not null default current_timestamp
);
-- Authentication keys
create table if not exists keys (
name text primary key,
key text not null,
admin boolean not null default false
);
--
-- Seed initial data.
--
-- Set default system key.
insert into keys(name,key,admin)
values ('foreman','potrzebie',true)
on conflict do nothing;
`