--- /dev/null
+Record::Arc.all.each do |rec|
+ arc = Arc.find(rec.code)
+ arc.thumbs = rec.thumbs.map { |t| t.video_id }
+ arc.save
+end
--- /dev/null
+class AddThumbsToArc < ActiveGroonga::Migration
+ def up
+ change_table(:arcs) do |table|
+ table.reference(:thumbs, "thumbs", :type => :vector)
+ end
+ end
+
+ def down
+ change_table(:arcs) do |table|
+ table.remove_column(:thumbs)
+ end
+ end
+end
-ActiveGroonga::Schema.define(:version => 20110707050534) do |schema|
+ActiveGroonga::Schema.define(:version => 20110707085913) do |schema|
schema.instance_eval do
create_table("arcs",
:type => :hash,
change_table("arcs") do |table|
table.reference("site", "sites")
+ table.reference("thumbs", "thumbs")
end
change_table("pmds") do |table|