Commit a2d4cad818286c429c6a27e0c936106969cd431d
1 parent
5429d2f0
Exists in
master
and in
1 other branch
schema changes to support fast presentation of results
Showing
2 changed files
with
20 additions
and
0 deletions
Show diff stats
@@ -0,0 +1,11 @@ | @@ -0,0 +1,11 @@ | ||
1 | +class AddDataToChoices < ActiveRecord::Migration | ||
2 | + def self.up | ||
3 | + add_column :choices, :data, :string | ||
4 | + puts "copying existing item data into associated choices ..." | ||
5 | + Choice.all.each {|c| c.data = c.item.data; c.save!} | ||
6 | + end | ||
7 | + | ||
8 | + def self.down | ||
9 | + remove_column :choices, :data | ||
10 | + end | ||
11 | +end |