Sha256: 46fb64b2f5a015a6b6175c214a92dbfcc59a92602fdc0ec89138d49003421337

Contents?: true

Size: 405 Bytes

Versions: 2

Compression:

Stored size: 405 Bytes

Contents

class ActsAsStarrableMigration < ActiveRecord::Migration
  def self.up
    create_table :ratings do |t|
      t.belongs_to :starrable, :polymorphic => true
      t.belongs_to :rater, :polymorphic => true
      t.integer :rating
    end
    
    add_index :ratings, [:starrable_id, :starrable_type]
    add_index :ratings, [:rater_id, :rater_type]
  end
  
  def self.down
    drop_table :ratings
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
acts_as_starrable-0.0.2 spec/dummy/db/migrate/20140412132501_acts_as_starrable_migration.rb
acts_as_starrable-0.0.1 spec/dummy/db/migrate/20140412132501_acts_as_starrable_migration.rb