Class: CreatePriceLogEntries
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreatePriceLogEntries
- Defined in:
- lib/generators/price_log/templates/create_price_log_entries.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
19 20 21 |
# File 'lib/generators/price_log/templates/create_price_log_entries.rb', line 19 def self.down drop_table :price_log_entries end |
.up ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/generators/price_log/templates/create_price_log_entries.rb', line 2 def self.up create_table :price_log_entries do |t| t.monetize :price t.datetime :start_date t.datetime :end_date t.references :priceable, :polymorphic => true t.string :priceable_field_name t. end add_index :price_log_entries, :start_date add_index :price_log_entries, :end_date add_index :price_log_entries, :priceable_field_name end |