diff options
author | 2017-04-18 18:35:02 -0400 | |
---|---|---|
committer | 2017-04-18 18:35:02 -0400 | |
commit | c25243291759c11fa2e5238d4612012498c45169 (patch) | |
tree | f8949f4f56ff6f7561e15e9233d83b0c677aba48 | |
parent | herds.xml is gone, but CVETool moves on (diff) | |
download | glsamaker-2.1.1.tar.gz glsamaker-2.1.1.tar.bz2 glsamaker-2.1.1.zip |
Generate migration to add slot support2.1.1
-rw-r--r-- | db/migrate/20170418102638_add_slots_to_packages.rb | 11 |
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 |