X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/3e99bbf5a9e124a59fc5ae72c863e89af7fa8c46..0f5ad1f3cc5d82efef93d2d17809145c5f68f233:/db/migrate/035_change_user_locale.rb diff --git a/db/migrate/035_change_user_locale.rb b/db/migrate/035_change_user_locale.rb index bfb43056a..4155fbced 100644 --- a/db/migrate/035_change_user_locale.rb +++ b/db/migrate/035_change_user_locale.rb @@ -1,8 +1,8 @@ -require 'migrate' +require "migrate" -class ChangeUserLocale < ActiveRecord::Migration +class ChangeUserLocale < ActiveRecord::Migration[5.0] 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 +10,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