Class: CreateBrowsingHistories

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

Instance Method Summary collapse

Instance Method Details

#downObject

Drop table



13
14
# File 'lib/generators/active_record/templates/migration.rb', line 13

def down
end

#upObject

Create table



3
4
5
6
7
8
9
10
# File 'lib/generators/active_record/templates/migration.rb', line 3

def up
  create_table :browsing_histories do |t|
    t.references :browser,      polymorphic: true, index: true
    t.references :historizable, polymorphic: true, index: true
    t.text       :object,       null: false
    t.timestamps                null: false
  end
end