about summary refs log tree commit diff
path: root/db/migrate/20200110214031_migrate_filter_undescribed_from_accounts.rb
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-01-10 20:07:15 -0600
committermultiple creatures <dev@multiple-creature.party>2020-01-10 20:07:15 -0600
commit1268277a8c203bcae515e0ccc8b3432119bafed2 (patch)
tree89fccc698a4a148f70a3ae10faf0ffef260200ec /db/migrate/20200110214031_migrate_filter_undescribed_from_accounts.rb
parent0090aca0453285ed6f4d55758ccd05200025d11a (diff)
add custom filter master toggle, add media gallery mode, & fix various filter logic + caching bugs
Diffstat (limited to 'db/migrate/20200110214031_migrate_filter_undescribed_from_accounts.rb')
-rw-r--r--db/migrate/20200110214031_migrate_filter_undescribed_from_accounts.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20200110214031_migrate_filter_undescribed_from_accounts.rb b/db/migrate/20200110214031_migrate_filter_undescribed_from_accounts.rb
new file mode 100644
index 000000000..6e29b9d44
--- /dev/null
+++ b/db/migrate/20200110214031_migrate_filter_undescribed_from_accounts.rb
@@ -0,0 +1,17 @@
+class MigrateFilterUndescribedFromAccounts < ActiveRecord::Migration[5.2]
+  def up
+    Account.local.find_each do |account|
+      account.user.update!(filter_undescribed: account.filter_undescribed)
+    end
+    safety_assured {
+      remove_column :accounts, :filter_undescribed
+    }
+  end
+
+  def down
+    return true
+    safety_assured {
+      add_column :accounts, :filter_undescribed, :boolean, null: true, default: false
+    }
+  end
+end