about summary refs log tree commit diff
path: root/db/migrate
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-07-19 07:26:47 -0500
committermultiple creatures <dev@multiple-creature.party>2019-07-19 07:26:47 -0500
commit66286178adabb4565409ff170794062a3ba31d4f (patch)
treefc74d4aa2b983b02b8b92a7758137d40bd3df70b /db/migrate
parent40debd9f80f363c06e03b8c67c076a1060016aab (diff)
migrate the kobolds from user setting to account
Diffstat (limited to 'db/migrate')
-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