Sha256: 57197941ed88b6fe8a769b49eda641b74a01e084265d9f9e2e36e8920176fd1e

Contents?: true

Size: 1.2 KB

Versions: 8

Compression:

Stored size: 1.2 KB

Contents

class FixCountryMapping < ActiveRecord::Migration[4.2]
  def up
    message = """ Important note about countries. Please read carefully!

The country mapping in lib/plugins/country_select/lib/country_select.rb
was found to be wrong. E.g. Australia was originally mapped to AS, which is
officially the ISO code for American Samoa. (This is just one example!)
From this point on, it will be mapped to AU, the correct ISO code for Australia.
It is critical that you run 'rake ffcrm:update_data:fix_countries' to fix your address data.

However, please note, this task should only ever be run ONCE!

If you run it multiple times on the same database then you will mess up your existing
address data. E.g. running once will map AS -> AU (Australia) and AU -> AT (Austria). If you run
that again, it will map all Australian countries to Austria!! (...and so on for all the
other mappings that have changed.)

Your database settings indicate that you have not run this task before.
Please BACK UP YOUR DATA and then run 'rake ffcrm:update_data:fix_countries'
before continuing any further.

This message will self-destruct in 10 seconds...

"""

    puts message unless Setting.have_run_country_migration
  end

  def down
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fat_free_crm-0.15.2 db/migrate/20121221033947_fix_country_mapping.rb
fat_free_crm-0.16.4 db/migrate/20121221033947_fix_country_mapping.rb
fat_free_crm-0.15.1 db/migrate/20121221033947_fix_country_mapping.rb
fat_free_crm-0.16.3 db/migrate/20121221033947_fix_country_mapping.rb
fat_free_crm-0.16.2 db/migrate/20121221033947_fix_country_mapping.rb
fat_free_crm-0.16.1 db/migrate/20121221033947_fix_country_mapping.rb
fat_free_crm-0.16.0 db/migrate/20121221033947_fix_country_mapping.rb
fat_free_crm-0.15.0 db/migrate/20121221033947_fix_country_mapping.rb