diff --git a/db/migrate/20140623100942_create_visits.rb b/db/migrate/20140623100942_create_visits.rb index 7527095b..f3a9e4c6 100644 --- a/db/migrate/20140623100942_create_visits.rb +++ b/db/migrate/20140623100942_create_visits.rb @@ -11,7 +11,6 @@ class CreateVisits < ActiveRecord::Migration else t.integer :visitor_id end - # the rest are recommended but optional # simply remove the columns you don't want diff --git a/db/migrate/20140623101032_create_ahoy_events.rb b/db/migrate/20140623101032_create_ahoy_events.rb index fcaf8c25..78a8ab2a 100644 --- a/db/migrate/20140623101032_create_ahoy_events.rb +++ b/db/migrate/20140623101032_create_ahoy_events.rb @@ -11,7 +11,7 @@ class CreateAhoyEvents < ActiveRecord::Migration else t.integer :visit_id end - + # user t.integer :user_id # add t.string :user_type if polymorphic diff --git a/db/migrate/20140821103643_split_ticket_price_in_price_and_currency.rb b/db/migrate/20140821103643_split_ticket_price_in_price_and_currency.rb index 77c70bd8..22e5bb8e 100644 --- a/db/migrate/20140821103643_split_ticket_price_in_price_and_currency.rb +++ b/db/migrate/20140821103643_split_ticket_price_in_price_and_currency.rb @@ -7,7 +7,7 @@ class SplitTicketPriceInPriceAndCurrency < ActiveRecord::Migration def change adapter_type = connection.adapter_name.downcase.to_sym - + case adapter_type when :postgresql add_monetize :tickets, :price @@ -15,7 +15,6 @@ class SplitTicketPriceInPriceAndCurrency < ActiveRecord::Migration add_money :tickets, :price end - TempTicket.all.each do |ticket| # Replace currency symbol with ISO Code if ticket.ticket_price diff --git a/db/migrate/20171118113113_change_visit_id_type_of_ahoy_events_to_integer.rb b/db/migrate/20171118113113_change_visit_id_type_of_ahoy_events_to_integer.rb index cbc72974..6951cd5f 100644 --- a/db/migrate/20171118113113_change_visit_id_type_of_ahoy_events_to_integer.rb +++ b/db/migrate/20171118113113_change_visit_id_type_of_ahoy_events_to_integer.rb @@ -3,14 +3,12 @@ class ChangeVisitIdTypeOfAhoyEventsToInteger < ActiveRecord::Migration[5.0] def change adapter_type = connection.adapter_name.downcase.to_sym - + case adapter_type when :postgresql change_column :ahoy_events, :visit_id, :integer, limit: nil, using: "('x' || translate(left(visit_id::text, 18), '-', ''))::bit(32)::int" else change_column :ahoy_events, :visit_id, :integer, limit: nil end - - end end