about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-02-15 10:50:31 -0600
committermultiple creatures <dev@multiple-creature.party>2020-02-15 10:50:31 -0600
commit5775e248675f60885eee31ba8d64e67f2b6dbf69 (patch)
tree80751a9cf8254cb0cab23a0fec94d8c69873a4a7 /db
parent13de392fc5769114015bb6780dce41e803fa6946 (diff)
set default column value in same migration
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20200215014558_add_hidden_to_statuses.rb2
-rw-r--r--db/migrate/20200215021730_set_default_unhidden_on_statuses.rb8
2 files changed, 1 insertions, 9 deletions
diff --git a/db/migrate/20200215014558_add_hidden_to_statuses.rb b/db/migrate/20200215014558_add_hidden_to_statuses.rb
index 886a2f7c4..47e1aefd0 100644
--- a/db/migrate/20200215014558_add_hidden_to_statuses.rb
+++ b/db/migrate/20200215014558_add_hidden_to_statuses.rb
@@ -1,5 +1,5 @@
 class AddHiddenToStatuses < ActiveRecord::Migration[5.2]
   def change
-    add_column :statuses, :hidden, :boolean
+    add_column :statuses, :hidden, :boolean, default: false
   end
 end
diff --git a/db/migrate/20200215021730_set_default_unhidden_on_statuses.rb b/db/migrate/20200215021730_set_default_unhidden_on_statuses.rb
deleted file mode 100644
index 1d239d110..000000000
--- a/db/migrate/20200215021730_set_default_unhidden_on_statuses.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-class SetDefaultUnhiddenOnStatuses < ActiveRecord::Migration[5.2]
-  def change
-    safety_assured do
-      change_column_default :statuses, :hidden, false
-      Status.in_batches.update_all(hidden: false)
-    end
-  end
-end