Sha256: 9e788d96d735ca654b728f7716fe3435fd39a7118e769e3d36c74c67d4a68550
Contents?: true
Size: 589 Bytes
Versions: 4
Compression:
Stored size: 589 Bytes
Contents
class ActsAsVotableMigration < ActiveRecord::Migration 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, [:votable_id, :votable_type] add_index :votes, [:voter_id, :voter_type] 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
4 entries across 2 versions & 1 rubygems