aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Amoss <ackle@gentoo.org>2017-04-18 18:35:02 -0400
committerSean Amoss <ackle@gentoo.org>2017-04-18 18:35:02 -0400
commitc25243291759c11fa2e5238d4612012498c45169 (patch)
treef8949f4f56ff6f7561e15e9233d83b0c677aba48
parentherds.xml is gone, but CVETool moves on (diff)
downloadglsamaker-c25243291759c11fa2e5238d4612012498c45169.tar.gz
glsamaker-c25243291759c11fa2e5238d4612012498c45169.tar.bz2
glsamaker-c25243291759c11fa2e5238d4612012498c45169.zip
Generate migration to add slot support2.1.1
-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