summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20210523232805_remove_usable_from_items.rb5
-rw-r--r--db/schema.rb3
-rw-r--r--db/seeds.rb5
3 files changed, 7 insertions, 6 deletions
diff --git a/db/migrate/20210523232805_remove_usable_from_items.rb b/db/migrate/20210523232805_remove_usable_from_items.rb
new file mode 100644
index 0000000..6e0dc61
--- /dev/null
+++ b/db/migrate/20210523232805_remove_usable_from_items.rb
@@ -0,0 +1,5 @@
+class RemoveUsableFromItems < ActiveRecord::Migration[6.1]
+ def change
+ remove_column :items, :usable
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 2568430..87f3473 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 2021_05_23_151747) do
+ActiveRecord::Schema.define(version: 2021_05_23_232805) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -136,7 +136,6 @@ ActiveRecord::Schema.define(version: 2021_05_23_151747) do
t.string "gid"
t.string "name"
t.text "description"
- t.boolean "usable"
t.jsonb "whatnot"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
diff --git a/db/seeds.rb b/db/seeds.rb
index 5a6c696..a1459cc 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -27,10 +27,7 @@ end
load_data_file("data/items.yml").map do |gid, hash|
item = Item.find_or_create_by(gid: gid)
- item.assign_attributes(hash.except(:equip_slot, :usable))
- item.equip_slot = hash[:equip_slot]&.to_sym
- item.usable = hash[:usable] || false
- item.save
+ item.update(hash)
end
load_data_file("data/locations.yml").map do |gid, hash|