Sha256: b19e5ba6c82122b2ae91f7527199345c4ff27ac0932178e166e78ab7fa24bc78

Contents?: true

Size: 509 Bytes

Versions: 2

Compression:

Stored size: 509 Bytes

Contents

class ActsAsVotableMigration < ActiveRecord::Migration<%= migration_version %>
  def self.up
    create_table :votes do |t|

      t.references :votable, polymorphic: true
      t.references :voter, polymorphic: true

      t.boolean :vote_flag
      t.string :vote_scope
      t.integer :vote_weight

      t.timestamps
    end

    add_index :votes, [:voter_id, :voter_type, :vote_scope]
    add_index :votes, [:votable_id, :votable_type, :vote_scope]
  end

  def self.down
    drop_table :votes
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
acts_as_votable-0.14.0 lib/generators/acts_as_votable/migration/templates/active_record/migration.erb
acts_as_votable-0.13.2 lib/generators/acts_as_votable/migration/templates/active_record/migration.erb