summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/sql/perms.sql7
-rw-r--r--util/sql/schema.sql11
-rw-r--r--util/updates/update_20191010.sql10
3 files changed, 23 insertions, 5 deletions
diff --git a/util/sql/perms.sql b/util/sql/perms.sql
index 6bf43a63..5e0f5df3 100644
--- a/util/sql/perms.sql
+++ b/util/sql/perms.sql
@@ -64,10 +64,9 @@ GRANT SELECT, INSERT, UPDATE, DELETE ON traits_parents TO vndb_site;
-- users table is special; The 'perm', 'passwd' and 'mail' columns are
-- protected and can only be accessed through the user_* functions.
-GRANT SELECT (id, username, registered, perm, c_votes, c_changes, ip, c_tags, ign_votes, email_confirmed, skin, customcss, filter_vn, filter_release, show_nsfw, hide_list, notify_dbedit, notify_announce, vn_list_own, vn_list_wish, tags_all, tags_cont, tags_ero, tags_tech, spoilers, traits_sexual),
- INSERT (id, username, mail, registered, c_votes, c_changes, ip, c_tags, ign_votes, email_confirmed, skin, customcss, filter_vn, filter_release, show_nsfw, hide_list, notify_dbedit, notify_announce, vn_list_own, vn_list_wish, tags_all, tags_cont, tags_ero, tags_tech, spoilers, traits_sexual),
- UPDATE ( username, registered, c_votes, c_changes, ip, c_tags, ign_votes, email_confirmed, skin, customcss, filter_vn, filter_release, show_nsfw, hide_list, notify_dbedit, notify_announce, vn_list_own, vn_list_wish, tags_all, tags_cont, tags_ero, tags_tech, spoilers, traits_sexual) ON users TO vndb_site;
-GRANT DELETE ON users TO vndb_site;
+GRANT SELECT (id, username, registered, perm, c_votes, c_changes, ip, c_tags, ign_votes, email_confirmed, skin, customcss, filter_vn, filter_release, show_nsfw, hide_list, notify_dbedit, notify_announce, vn_list_own, vn_list_wish, tags_all, tags_cont, tags_ero, tags_tech, spoilers, traits_sexual, nodistract_can, nodistract_noads, nodistract_nofancy, support_can, support_enabled, uniname_can, uniname, pubskin_can, pubskin_enabled),
+ INSERT (id, username, mail, registered, c_votes, c_changes, ip, c_tags, ign_votes, email_confirmed, skin, customcss, filter_vn, filter_release, show_nsfw, hide_list, notify_dbedit, notify_announce, vn_list_own, vn_list_wish, tags_all, tags_cont, tags_ero, tags_tech, spoilers, traits_sexual, nodistract_can, nodistract_noads, nodistract_nofancy, support_can, support_enabled, uniname_can, uniname, pubskin_can, pubskin_enabled),
+ UPDATE ( username, registered, c_votes, c_changes, ip, c_tags, ign_votes, email_confirmed, skin, customcss, filter_vn, filter_release, show_nsfw, hide_list, notify_dbedit, notify_announce, vn_list_own, vn_list_wish, tags_all, tags_cont, tags_ero, tags_tech, spoilers, traits_sexual, nodistract_can, nodistract_noads, nodistract_nofancy, support_can, support_enabled, uniname_can, uniname, pubskin_can, pubskin_enabled) ON users TO vndb_site;
GRANT SELECT, INSERT, UPDATE ON vn TO vndb_site;
GRANT SELECT, INSERT, DELETE ON vn_anime TO vndb_site;
diff --git a/util/sql/schema.sql b/util/sql/schema.sql
index 7db233d1..a3c65c7b 100644
--- a/util/sql/schema.sql
+++ b/util/sql/schema.sql
@@ -734,7 +734,16 @@ CREATE TABLE users (
tags_ero boolean NOT NULL DEFAULT FALSE,
tags_tech boolean NOT NULL DEFAULT TRUE,
spoilers smallint NOT NULL DEFAULT 0,
- traits_sexual boolean NOT NULL DEFAULT FALSE
+ traits_sexual boolean NOT NULL DEFAULT FALSE,
+ nodistract_can boolean NOT NULL DEFAULT FALSE,
+ nodistract_noads boolean NOT NULL DEFAULT FALSE,
+ nodistract_nofancy boolean NOT NULL DEFAULT FALSE,
+ support_can boolean NOT NULL DEFAULT FALSE,
+ support_enabled boolean NOT NULL DEFAULT FALSE,
+ uniname_can boolean NOT NULL DEFAULT FALSE,
+ uniname text NOT NULL DEFAULT '',
+ pubskin_can boolean NOT NULL DEFAULT FALSE,
+ pubskin_enabled boolean NOT NULL DEFAULT FALSE
);
-- vn
diff --git a/util/updates/update_20191010.sql b/util/updates/update_20191010.sql
new file mode 100644
index 00000000..1cdf898f
--- /dev/null
+++ b/util/updates/update_20191010.sql
@@ -0,0 +1,10 @@
+ALTER TABLE users ADD COLUMN nodistract_can boolean NOT NULL DEFAULT FALSE;
+ALTER TABLE users ADD COLUMN nodistract_noads boolean NOT NULL DEFAULT FALSE;
+ALTER TABLE users ADD COLUMN nodistract_nofancy boolean NOT NULL DEFAULT FALSE;
+ALTER TABLE users ADD COLUMN support_can boolean NOT NULL DEFAULT FALSE;
+ALTER TABLE users ADD COLUMN support_enabled boolean NOT NULL DEFAULT FALSE;
+ALTER TABLE users ADD COLUMN uniname_can boolean NOT NULL DEFAULT FALSE;
+ALTER TABLE users ADD COLUMN uniname text NOT NULL DEFAULT '';
+ALTER TABLE users ADD COLUMN pubskin_can boolean NOT NULL DEFAULT FALSE;
+ALTER TABLE users ADD COLUMN pubskin_enabled boolean NOT NULL DEFAULT FALSE;
+\i util/sql/perms.sql