X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/0e96027a209d59ff5e7f5c2b1405febc59664a16..95e1aff23493b3725d5259bcca7bcc79d7d3bc26:/db/migrate/035_change_user_locale.rb?ds=inline diff --git a/db/migrate/035_change_user_locale.rb b/db/migrate/035_change_user_locale.rb index 7dc80549e..d1315fa06 100644 --- a/db/migrate/035_change_user_locale.rb +++ b/db/migrate/035_change_user_locale.rb @@ -1,8 +1,6 @@ -require 'lib/migrate' - -class ChangeUserLocale < ActiveRecord::Migration +class ChangeUserLocale < ActiveRecord::Migration[4.2] def self.up - remove_foreign_key :users, [:locale], :languages, [:code] + remove_foreign_key :users, :column => :locale, :name => "users_locale_fkey" rename_column :users, :locale, :languages end @@ -10,6 +8,6 @@ class ChangeUserLocale < ActiveRecord::Migration def self.down rename_column :users, :languages, :locale - add_foreign_key :users, [:locale], :languages, [:code] + add_foreign_key :users, :languages, :column => :locale, :primary_key => :code, :name => "users_locale_fkey" end end