summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-08-24 16:41:20 +0200
committerYorhel <git@yorhel.nl>2020-08-24 16:41:22 +0200
commita8a97a6a0bcb4ff36804b79280ba5c9263fe233b (patch)
tree4f20acfa90d79dcda6b66ac73f2c155dddca1b57 /util
parentdda6647d207ea26800c5dbf3b326c88eccaa2c66 (diff)
reviews: Get rid of summary field & split mini/full reviews
Much to my disappointment, people don't write proper summaries and, as such, summaries are not useful to be considered a "short review" on their own right. This necessitates splitting the reviews onto different pages.
Diffstat (limited to 'util')
-rw-r--r--util/updates/2020-08-24-reviews-nosummary.sql6
1 files changed, 6 insertions, 0 deletions
diff --git a/util/updates/2020-08-24-reviews-nosummary.sql b/util/updates/2020-08-24-reviews-nosummary.sql
new file mode 100644
index 00000000..7333a2fc
--- /dev/null
+++ b/util/updates/2020-08-24-reviews-nosummary.sql
@@ -0,0 +1,6 @@
+ALTER TABLE reviews ADD COLUMN isfull boolean NOT NULL DEFAULT false;
+UPDATE reviews SET isfull = text <> '';
+UPDATE reviews SET text = summary WHERE NOT isfull;
+UPDATE reviews SET text = summary || text WHERE isfull;
+ALTER TABLE reviews ALTER COLUMN isfull DROP DEFAULT;
+ALTER TABLE reviews DROP COLUMN summary;