Cleanup current issues with schema, and regenerate latter

This commit is contained in:
KalabiYau 2014-07-04 22:39:05 +02:00 committed by Artem Chernikov
parent 78cdbf81a1
commit bce32255fa
3 changed files with 8 additions and 14 deletions

View file

@ -1,7 +1,6 @@
class CreateVisits < ActiveRecord::Migration
def change
create_table :visits, id: false do |t|
t.uuid :id, primary_key: true
create_table :visits do |t|
t.uuid :visitor_id
# the rest are recommended but optional

View file

@ -1,20 +1,17 @@
class CreateAhoyEvents < ActiveRecord::Migration
def change
create_table :ahoy_events, id: false do |t|
t.uuid :id, primary_key: true
create_table :ahoy_events do |t|
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
add_index :ahoy_events, [:visit_id]
add_index :ahoy_events, [:user_id]
add_index :ahoy_events, [:time]
add_index :ahoy_events, :visit_id
add_index :ahoy_events, :user_id
add_index :ahoy_events, :time
end
end