summaryrefslogtreecommitdiff
path: root/util/sql
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-10-03 14:49:07 +0200
committerYorhel <git@yorhel.nl>2019-10-03 14:49:18 +0200
commit89483d60d5df8346473a50734df4825210c70d3b (patch)
tree7c6c2f18735eb83561992053d8f2d9c35dfdea16 /util/sql
parentdbade31a5b581d7534bae94404ce5b120034bde9 (diff)
Fix spoilers preference to be a smallint rather than boolean
And for those who (like me) already applied update_20191003.sql, here's a partial fix: alter table users alter column spoilers drop default; alter table users alter column spoilers type smallint using (case when spoilers then 1 else 0 end); alter table users alter column spoilers set default 0; But you'll still need to import the old preference for users who had spoilers=2, because those will have been lost.
Diffstat (limited to 'util/sql')
-rw-r--r--util/sql/schema.sql2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/sql/schema.sql b/util/sql/schema.sql
index fa18937f..aa64289a 100644
--- a/util/sql/schema.sql
+++ b/util/sql/schema.sql
@@ -734,7 +734,7 @@ CREATE TABLE users (
tags_cont boolean NOT NULL DEFAULT TRUE,
tags_ero boolean NOT NULL DEFAULT FALSE,
tags_tech boolean NOT NULL DEFAULT TRUE,
- spoilers boolean NOT NULL DEFAULT FALSE,
+ spoilers smallint NOT NULL DEFAULT 0,
traits_sexual boolean NOT NULL DEFAULT FALSE
);