Sha256: c6208e88116cd738ef529daffa8f1177c63d8e2e3c68e25a2465429656744d19

Contents?: true

Size: 566 Bytes

Versions: 1

Compression:

Stored size: 566 Bytes

Contents

class CreateReputationsTable < ActiveRecord::Migration
  def self.up
    create_table :reputations, :force => true do |t|
      t.integer :user_id
      t.integer :reputation_action_id
      t.integer :value
      t.timestamps
    end
    
    add_index :reputations, [:user_id,:reputation_action_id], :name => "user_reputation", :unique => false
    add_index :reputations, :reputation_action_id
  end

  def self.down
    remove_index :reputations, :reputation_action_id
    remove_index :reputations, :name=> :user_reputation
    drop_table :reputations
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
social_engine-0.0.1 lib/generators/social_engine/install/templates/create_reputations_table.rb