about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-02-17 02:26:52 -0600
committermultiple creatures <dev@multiple-creature.party>2020-02-17 02:26:52 -0600
commit2427cced78580da729a0ac6a1dc52b2d206aa11c (patch)
treee0b703674d3a1fb523b447eb512ff0b2ac6ddd65 /db
parent8bf7e00362b4e5bf29e3841bd871590871b5257d (diff)
add a `manual_only` (manual trust only) moderation option + handle more `reject_unknown`/graylist mode caveats
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20200217052742_add_manual_only_to_domain_block.rb5
-rw-r--r--db/migrate/20200217055054_add_manual_only_to_accounts.rb5
-rw-r--r--db/structure.sql17
3 files changed, 23 insertions, 4 deletions
diff --git a/db/migrate/20200217052742_add_manual_only_to_domain_block.rb b/db/migrate/20200217052742_add_manual_only_to_domain_block.rb
new file mode 100644
index 000000000..ae07a5504
--- /dev/null
+++ b/db/migrate/20200217052742_add_manual_only_to_domain_block.rb
@@ -0,0 +1,5 @@
+class AddManualOnlyToDomainBlock < ActiveRecord::Migration[5.2]
+  def change
+    safety_assured { add_column :domain_blocks, :manual_only, :boolean, default: false, null: false }
+  end
+end
diff --git a/db/migrate/20200217055054_add_manual_only_to_accounts.rb b/db/migrate/20200217055054_add_manual_only_to_accounts.rb
new file mode 100644
index 000000000..3d67a09f4
--- /dev/null
+++ b/db/migrate/20200217055054_add_manual_only_to_accounts.rb
@@ -0,0 +1,5 @@
+class AddManualOnlyToAccounts < ActiveRecord::Migration[5.2]
+  def change
+    safety_assured { add_column(:accounts, :manual_only, :boolean, default: false, null: false) }
+  end
+end
diff --git a/db/structure.sql b/db/structure.sql
index d0f9eb481..e8d415200 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -551,7 +551,8 @@ CREATE TABLE public.accounts (
     force_private boolean DEFAULT false NOT NULL,
     unboostable boolean DEFAULT false NOT NULL,
     block_anon boolean DEFAULT false NOT NULL,
-    trust_level integer
+    trust_level integer,
+    manual_only boolean DEFAULT false NOT NULL
 );
 
 
@@ -973,7 +974,8 @@ CREATE TABLE public.domain_blocks (
     force_sensitive boolean DEFAULT false NOT NULL,
     reason text,
     reject_unknown boolean DEFAULT false NOT NULL,
-    processing boolean DEFAULT true NOT NULL
+    processing boolean DEFAULT true NOT NULL,
+    manual_only boolean DEFAULT false NOT NULL
 );
 
 
@@ -2225,7 +2227,8 @@ CREATE TABLE public.statuses (
     boostable boolean,
     reject_replies boolean,
     tsv tsvector GENERATED ALWAYS AS (to_tsvector('public.fedi'::regconfig, public.f_strip_mentions(((spoiler_text || ' '::text) || text)))) STORED,
-    hidden boolean
+    hidden boolean,
+    CONSTRAINT statuses_hidden_null CHECK ((hidden IS NOT NULL))
 );
 
 
@@ -5415,6 +5418,12 @@ INSERT INTO "schema_migrations" (version) VALUES
 ('20200115201524'),
 ('20200205194250'),
 ('20200215014558'),
-('20200215020121');
+('20200215020121'),
+('20200215021014'),
+('20200215021731'),
+('20200215021732'),
+('20200216000613'),
+('20200217052742'),
+('20200217055054');