Fixing Migration crashes on MySQL/MariaDB & PostgreSQL
This commit is contained in:
parent
2a0552d6b2
commit
6cd1de21dd
7 changed files with 78 additions and 38 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue