about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-04-19 00:25:52 -0500
committermultiple creatures <dev@multiple-creature.party>2019-05-21 03:16:22 -0500
commitf7c5171a837c0baeb16f43dfe05beac9c6f6b78a (patch)
tree3dedd85b2d6b7c68a8d25384309ff98ff05bfe28 /db
parentb8b525c54a728f8ff88a53c7ceccff726cf45f30 (diff)
DB: Replace `NULL` boolean values with `FALSE` in Monsterpit feature columns; add `vars` column for persistent bangtag variable storage.
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20190419040911_add_vars_to_accounts.rb5
-rw-r--r--db/migrate/20190419045308_monsterpit_remove_nulls.rb19
-rw-r--r--db/schema.rb6
3 files changed, 28 insertions, 2 deletions
diff --git a/db/migrate/20190419040911_add_vars_to_accounts.rb b/db/migrate/20190419040911_add_vars_to_accounts.rb
new file mode 100644
index 000000000..86e64ba33
--- /dev/null
+++ b/db/migrate/20190419040911_add_vars_to_accounts.rb
@@ -0,0 +1,5 @@
+class AddVarsToAccounts < ActiveRecord::Migration[5.2]
+  def change
+    add_column :accounts, :vars, :jsonb
+  end
+end
diff --git a/db/migrate/20190419045308_monsterpit_remove_nulls.rb b/db/migrate/20190419045308_monsterpit_remove_nulls.rb
new file mode 100644
index 000000000..32701d58a
--- /dev/null
+++ b/db/migrate/20190419045308_monsterpit_remove_nulls.rb
@@ -0,0 +1,19 @@
+class MonsterpitRemoveNulls < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+
+  def change
+    safety_assured do
+      change_column_null :statuses, :curated, false, false
+      change_column_default :statuses, :curated, false
+
+      change_column_null :statuses, :network, false, false
+      change_column_default :statuses, :network, false
+
+      change_column_null :accounts, :hidden, false, false
+      change_column_default :accounts, :hidden, false
+
+      change_column_null :accounts, :vars, false, {}
+      change_column_default :accounts, :vars, {}
+    end
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 8ef96aac1..e90f90307 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -149,6 +149,8 @@ ActiveRecord::Schema.define(version: 2019_05_19_130537) do
     t.datetime "silenced_at"
     t.datetime "suspended_at"
     t.boolean "hidden"
+    t.boolean "hidden", default: false, null: false
+    t.jsonb "vars", default: {}, null: false
     t.index "(((setweight(to_tsvector('simple'::regconfig, (display_name)::text), 'A'::\"char\") || setweight(to_tsvector('simple'::regconfig, (username)::text), 'B'::\"char\")) || setweight(to_tsvector('simple'::regconfig, (COALESCE(domain, ''::character varying))::text), 'C'::\"char\")))", name: "search_index", using: :gin
     t.index "lower((username)::text), lower((domain)::text)", name: "index_accounts_on_username_and_domain_lower", unique: true
     t.index ["moved_to_account_id"], name: "index_accounts_on_moved_to_account_id"
@@ -640,9 +642,9 @@ ActiveRecord::Schema.define(version: 2019_05_19_130537) do
     t.bigint "poll_id"
     t.string "content_type"
     t.tsvector "tsv"
-    t.boolean "curated"
+    t.boolean "curated", default: false, null: false
     t.string "sharekey"
-    t.boolean "network"
+    t.boolean "network", default: false, null: false
     t.index ["account_id", "id", "visibility", "updated_at"], name: "index_statuses_20180106", order: { id: :desc }
     t.index ["in_reply_to_account_id"], name: "index_statuses_on_in_reply_to_account_id"
     t.index ["in_reply_to_id"], name: "index_statuses_on_in_reply_to_id"