Class: CreateCustomAutoIncrements

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

Instance Method Summary collapse

Instance Method Details

#downObject



12
13
14
# File 'lib/generators/protokoll/migration/templates/create_custom_auto_increments.rb', line 12

def down
  drop_table :custom_auto_increments
end

#upObject



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.timestamps
  end

  add_index :custom_auto_increments, :counter_model_name
end