about summary refs log tree commit diff
path: root/db/migrate/20200904200803_backfill_default_false_to_local_only.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20200904200803_backfill_default_false_to_local_only.rb')
-rw-r--r--db/migrate/20200904200803_backfill_default_false_to_local_only.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/db/migrate/20200904200803_backfill_default_false_to_local_only.rb b/db/migrate/20200904200803_backfill_default_false_to_local_only.rb
new file mode 100644
index 000000000..236a01c14
--- /dev/null
+++ b/db/migrate/20200904200803_backfill_default_false_to_local_only.rb
@@ -0,0 +1,13 @@
+class BackfillDefaultFalseToLocalOnly < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+
+  def up
+    safety_assured do
+      execute('UPDATE statuses SET local_only = false WHERE local_only IS NULL')
+    end
+  end
+
+  def down
+    nil
+  end
+end