summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-07-29 12:02:00 +0200
committerYorhel <git@yorhel.nl>2020-07-29 12:03:28 +0200
commit55ed28a8dcc7fe5f22fe5259c5a518233c2b8bdc (patch)
tree4c6ec1c15dbdbb88a11de2af1240b55a33553250 /util
parent8bc45a4b082438595f63dcb876f1e2215a341caf (diff)
Reports: Keep track of unseen, new and last updated reports
Diffstat (limited to 'util')
-rw-r--r--util/updates/2020-07-29-reports-last-seen.sql5
1 files changed, 5 insertions, 0 deletions
diff --git a/util/updates/2020-07-29-reports-last-seen.sql b/util/updates/2020-07-29-reports-last-seen.sql
new file mode 100644
index 00000000..e38c5f54
--- /dev/null
+++ b/util/updates/2020-07-29-reports-last-seen.sql
@@ -0,0 +1,5 @@
+ALTER TABLE users ADD COLUMN last_reports timestamptz;
+DROP INDEX reports_status;
+CREATE INDEX reports_new ON reports (date) WHERE status = 'new';
+CREATE INDEX reports_lastmod ON reports (lastmod);
+\i sql/perms.sql