I'm seeing this error when I try a rake db:migrate:
/db/migrate/20180124161533_a_dd_uid_to_appuser_and_response.rb:22: syntax error, unexpected '\n', expecting => From what I can see, I don't see any new lines in the migration file though:
class ADdUidToAppuserAndResponse < ActiveRecord::Migration disable_ddl_transaction! def change add_column :appusers, :archived, :boolean, algorithm: :concurrently, if !column_exists?(:appusers, :archived) add_column :responses, :archived, :boolean, algorithm: :concurrently, if !column_exists?(:responses, :archived) add_column :appuser_rewards, :archived, :boolean, algorithm: :concurrently, if !column_exists?(:appuser_rewards, :archived) add_column :appusers, :last_checked_campaigns_at, :datetime, algorithm: :concurrently, if !column_exists?(:appusers, :last_checked_campaigns_at) add_column :appusers, :last_checked_for_available_campaigns_at, :datetime, algorithm: :concurrently, if !column_exists?(:appusers, :last_checked_for_available_campaigns_at) add_column :appusers, :uid, :uuid, default: 'uuid_generate_v4()', algorithm: :concurrently, if !column_exists?(:appusers, :uid) add_column :responses, :uid, :uuid, default: 'uuid_generate_v4()', algorithm: :concurrently, if !column_exists?(:responses, :uid) add_column :appuser_rewards, :uuid, :uuid, default: 'uuid_generate_v4()', algorithm: :concurrently, if !column_exists?(:appusers, :uuid) add_index :appusers, :uid, algorithm: :concurrently, where: "archived = false", if !index_exists?(:appusers, :uid) add_index :responses, :uid, algorithm: :concurrently, where: "archived = false", if !index_exists?(:responses, :uid) end end Any idea what the problem is?
add_columnandadd_indexcalls.m x, if ...tells Ruby that theifis an expression that will produce another argument tom,m x if ...ism(x)with a postfix conditional.