Fixing Migration crashes on MySQL/MariaDB & PostgreSQL

This commit is contained in:
Jose D. Gomez R 2019-03-12 17:04:13 -04:00 committed by José D. Gómez R
parent 2a0552d6b2
commit 6cd1de21dd
7 changed files with 78 additions and 38 deletions

View file

@ -2,8 +2,16 @@
class CreateAhoyEvents < ActiveRecord::Migration
def change
adapter_type = connection.adapter_name.downcase.to_sym
create_table :ahoy_events do |t|
t.uuid :visit_id
case adapter_type
when :postgresql
t.uuid :visit_id
else
t.integer :visit_id
end
# user
t.integer :user_id
# add t.string :user_type if polymorphic