about summary refs log tree commit diff
path: root/db/migrate
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/migrate
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/migrate')
-rw-r--r--db/migrate/20190419040911_add_vars_to_accounts.rb5
-rw-r--r--db/migrate/20190419045308_monsterpit_remove_nulls.rb19
2 files changed, 24 insertions, 0 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