Class: CreateTotals
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateTotals
- Defined in:
- lib/generators/how_are_we_doing/install/templates/db/migrate/create_totals.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
13 14 15 |
# File 'lib/generators/how_are_we_doing/install/templates/db/migrate/create_totals.rb', line 13 def self.down drop_table :totals end |
.up ⇒ Object
2 3 4 5 6 7 8 9 10 11 |
# File 'lib/generators/how_are_we_doing/install/templates/db/migrate/create_totals.rb', line 2 def self.up create_table :totals do |t| t.references :totalable, :polymorphic => true t.references :user t. end add_index :totals, [:totalable_id, :totalable_type] add_index :totals, :user_id end |