Class: ActsAsTaggableOnMigration
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- ActsAsTaggableOnMigration
- Defined in:
- lib/generators/acts_as_meritocracy/migration/templates/active_record/migration.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
16 17 18 |
# File 'lib/generators/acts_as_meritocracy/migration/templates/active_record/migration.rb', line 16 def self.down drop_table :votes end |
.up ⇒ Object
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 |