summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/migrate/20170418102638_add_slots_to_packages.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/db/migrate/20170418102638_add_slots_to_packages.rb b/db/migrate/20170418102638_add_slots_to_packages.rb
new file mode 100644
index 0000000..73e21e9
--- /dev/null
+++ b/db/migrate/20170418102638_add_slots_to_packages.rb
@@ -0,0 +1,11 @@
+class AddSlotsToPackages < ActiveRecord::Migration
+ def change
+ add_column :packages, :slot, :string
+ Package.find_each do |package|
+ if package.slot.nil?
+ package.slot = '*'
+ package.save!
+ end
+ end
+ end
+end