2014-06-26 09:08:26 +02:00
|
|
|
class CreateAhoyEvents < ActiveRecord::Migration
|
|
|
|
|
def change
|
2014-07-04 22:39:05 +02:00
|
|
|
create_table :ahoy_events do |t|
|
2014-06-26 09:08:26 +02:00
|
|
|
t.uuid :visit_id
|
|
|
|
|
# user
|
|
|
|
|
t.integer :user_id
|
|
|
|
|
# add t.string :user_type if polymorphic
|
|
|
|
|
t.string :name
|
|
|
|
|
t.text :properties
|
|
|
|
|
t.timestamp :time
|
|
|
|
|
end
|
|
|
|
|
|
2014-07-04 22:39:05 +02:00
|
|
|
add_index :ahoy_events, :visit_id
|
|
|
|
|
add_index :ahoy_events, :user_id
|
|
|
|
|
add_index :ahoy_events, :time
|
2014-06-26 09:08:26 +02:00
|
|
|
end
|
|
|
|
|
end
|