Files
grecia/db/migrate/20150804144231_create_ahoy_events.rb
Julian Herrero 65c30c8d2d Remove migrations warning
DEPRECATION WARNING: Directly inheriting from ActiveRecord::Migration
is deprecated. Please specify the Rails release the migration was
written for:

class MigrationClass < ActiveRecord::Migration[4.2]

(called from require at bin/rails:4)
2019-04-17 17:40:56 +02:00

21 lines
494 B
Ruby

class CreateAhoyEvents < ActiveRecord::Migration[4.2]
def change
create_table :ahoy_events, id: false do |t|
t.uuid :id, default: nil, primary_key: true
t.uuid :visit_id, default: nil
# user
t.integer :user_id
# add t.string :user_type if polymorphic
t.string :name
t.jsonb :properties
t.timestamp :time
end
add_index :ahoy_events, [:visit_id]
add_index :ahoy_events, [:user_id]
add_index :ahoy_events, [:time]
end
end