Class: ActsAsTaggableOnMigration

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/acts_as_meritocracy/migration/templates/active_record/migration.rb

Class Method Summary collapse

Class Method Details

.downObject



16
17
18
# File 'lib/generators/acts_as_meritocracy/migration/templates/active_record/migration.rb', line 16

def self.down
  drop_table :votes
end

.upObject



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/generators/acts_as_meritocracy/migration/templates/active_record/migration.rb', line 3

def self.up
  create_table :votes, :force => true do |t|
    t.integer :voter_id, :limit => 11
    t.references :voteable, :polymorphic=>true
    t.integer :vote_weight, :default=>1
    t.integer :vote, :default=>1
    t.datetime :updated_at
    t.datetime :created_at
  end
  add_index :votes, :tag_id
  add_index :votes, [:voteable_id, :voteable_type]
end