Class: CreateCustomAutoIncrements
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateCustomAutoIncrements
- Defined in:
- lib/generators/protokoll/migration/templates/create_custom_auto_increments.rb
Instance Method Summary collapse
Instance Method Details
#down ⇒ Object
12 13 14 |
# File 'lib/generators/protokoll/migration/templates/create_custom_auto_increments.rb', line 12 def down drop_table :custom_auto_increments end |
#up ⇒ Object
2 3 4 5 6 7 8 9 10 |
# File 'lib/generators/protokoll/migration/templates/create_custom_auto_increments.rb', line 2 def up create_table :custom_auto_increments, :force => true do |t| t.string :counter_model_name t.integer :counter, :default => 0 t. end add_index :custom_auto_increments, :counter_model_name end |