public
Rubygem
Description: Alpha software / experimental - A Ruby gem which adds simple item-to-item collaborative filtering to ActiveRecord-based apps.
Clone URL: git://github.com/dancroak/recommendable.git
(no author) (author)
Mon Mar 31 22:41:19 -0700 2008
commit  d24ed8e25cb7ec3514500fbe3e9a3a253e4a8a87
tree    f6925517140a9e9bdd8cf12e90e9b11f6ead1bcb
parent  8fc5a3a7122de0afbcc336907fce6a429a9c47c0
100644 20 lines (17 sloc) 0.511 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class CreateRecommendations < ActiveRecord::Migration
  def self.up
    create_table :recommendations do |t|
      t.integer :recommended_id
      t.string :recommeded_type
      t.integer :recommender_id
      t.decimal :score
    end
    
    add_index :recommendations, :recommended_id
    add_index :recommendations, :recommender_id
    add_index :recommendations, :score
    add_index :recommendations, [:recommended_id, :recommeded_type]
  end
  
  def self.down
    drop_table :recommendations
  end
end