about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--db/migrate/20190719121326_migrate_user_kobolds_to_account.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/db/migrate/20190719121326_migrate_user_kobolds_to_account.rb b/db/migrate/20190719121326_migrate_user_kobolds_to_account.rb
new file mode 100644
index 000000000..5413aaaab
--- /dev/null
+++ b/db/migrate/20190719121326_migrate_user_kobolds_to_account.rb
@@ -0,0 +1,10 @@
+class MigrateUserKoboldsToAccount < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+  def up
+    Account.local.find_each do |account|
+      account.kobold = a.user_is_a_kobold? || false
+      account.gently = a.user_gentlies_kobolds? || false
+      account.save
+    end
+  end
+end