You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update SetupDatabase.sh
bugfix - missing `-ddaq` when setting up indices
* Update SetupDatabase.sh
missing subject specification on demo monitoring data
psql -ddaq -c "create table monitoring (time timestamp with time zone NOT NULL, device text NOT NULL, subject text NOT NULL, data JSONB NOT NULL);"
64
64
65
65
echo"creating indices on device name and subject"
66
-
psql -c "CREATE INDEX ON monitoring (device) WITH (deduplicate_items = on);"
66
+
psql -ddaq -c "CREATE INDEX ON monitoring (device) WITH (deduplicate_items = on);"
67
67
# this may be more efficient as we're unlikely to search by subject alone...
68
-
psql -c "CREATE INDEX ON monitoring (device, subject) WITH (deduplicate_items = on);"
68
+
psql -ddaq -c "CREATE INDEX ON monitoring (device, subject) WITH (deduplicate_items = on);"
69
69
70
70
echo"creating logging table"
71
71
psql -ddaq -c "create table logging (time timestamp with time zone NOT NULL, device text NOT NULL, severity integer NOT NULL, message text NOT NULL);"
72
72
73
73
echo"creating indices on device name and message severity"
74
-
psql -c "CREATE INDEX ON logging (device) WITH (deduplicate_items = on);"
74
+
psql -ddaq -c "CREATE INDEX ON logging (device) WITH (deduplicate_items = on);"
75
75
# as above. is anyone really going to want 'high priority logs from any device'? i doubt it
76
-
psql -c "CREATE INDEX ON logging (device,severity) WITH (deduplicate_items = on);"
76
+
psql -ddaq -c "CREATE INDEX ON logging (device,severity) WITH (deduplicate_items = on);"
77
77
78
78
echo"creating alarms table"
79
79
psql -ddaq -c "create table alarms (time timestamp with time zone NOT NULL, device text NOT NULL, level integer NOT NULL, alarm text NOT NULL, silenced integer DEFAULT 0 );"
@@ -114,7 +114,7 @@ echo "Inserting a default user"
psql -ddaq -c "INSERT INTO monitoring (time, device, data) SELECT now() - (i * INTERVAL '1 minute') AS time, 'test_device' AS device, jsonb_build_object( 'temperature', round((random() * 50 + 10)::numeric, 2), 'humidity', round((random() * 100)::numeric, 2)) AS data FROM generate_series(1, 100) i;"
117
+
psql -ddaq -c "INSERT INTO monitoring (time, device, subject, data) SELECT now() - (i * INTERVAL '1 minute') AS time, 'test_device' AS device, 'general' AS subject, jsonb_build_object( 'temperature', round((random() * 50 + 10)::numeric, 2), 'humidity', round((random() * 100)::numeric, 2)) AS data FROM generate_series(1, 100) i;"
0 commit comments