Only display active nodes for support requests
authorClinton Ebadi <clinton@unknownlamer.org>
Tue, 25 Mar 2014 04:46:24 +0000 (00:46 -0400)
committerClinton Ebadi <clinton@unknownlamer.org>
Tue, 25 Mar 2014 04:46:24 +0000 (00:46 -0400)
We need to keep old nodes around for historical data to remaining
consistent, but there's no need to clog up the interface with them.

create-active-node-table.sql [new file with mode: 0644]
init.sml

diff --git a/create-active-node-table.sql b/create-active-node-table.sql
new file mode 100644 (file)
index 0000000..0ecbfd8
--- /dev/null
@@ -0,0 +1,12 @@
+BEGIN;
+
+CREATE TABLE ActiveWebNode
+(
+       id integer primary key,
+       foreign key (id) references WebNode
+);
+
+INSERT INTO ActiveWebNode (id) VALUES (3);
+INSERT INTO ActiveWebNode (id) VALUES (4);
+
+COMMIT;
index 6ed6c9a..f6f5e7c 100644 (file)
--- a/init.sml
+++ b/init.sml
@@ -208,6 +208,7 @@ fun mkNodeRow [id, name, descr, debian] =
 fun listNodes () =
     C.map (getDb ()) mkNodeRow ($`SELECT id, name, descr, debian
                                  FROM WebNode
+                                  WHERE id IN (SELECT id FROM ActiveWebNode)
                                  ORDER BY name`)
 
 fun nodeName id =