Class: CreateBuckets

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

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
# File 'lib/generators/templates/active_recordable_migration.rb', line 2

def change
  #
  create_table :buckets do |t|
    t.string      :series_key
    t.string      :group_name
    t.references  :bucketable, polymorphic: true
    t.timestamps
  end
  add_index :buckets, :series_key
end