From 2bad3f46cdd8decee7d2d9b804ac7c75b5a1cc5d Mon Sep 17 00:00:00 2001 From: bogdanvlviv Date: Mon, 23 Jul 2018 03:33:25 +0300 Subject: Add foreign key to active_storage_attachments for `blob_id` via new migration We need this in order to be able to add this migration for users that use ActiveStorage during update their apps from Rails 5.2 to Rails 6.0. Related to #33405 `rake app:update` should update active_storage `rake app:update` should execute `rake active_storage:update` if it is used in the app that is being updated. It will add new active_storage's migrations to users' apps during update Rails. Context https://github.com/rails/rails/pull/33405#discussion_r204239399 Also, see a related discussion in the Campfire: https://3.basecamp.com/3076981/buckets/24956/chats/12416418@1236713081 --- activerecord/lib/active_record/railties/databases.rake | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord/lib/active_record/railties/databases.rake') diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index d24324ecce..8de06e8466 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -407,6 +407,10 @@ namespace :railties do if railtie.respond_to?(:paths) && (path = railtie.paths["db/migrate"].first) railties[railtie.railtie_name] = path end + + unless ENV["MIGRATIONS_PATH"].blank? + railties[railtie.railtie_name] = railtie.root + ENV["MIGRATIONS_PATH"] + end end on_skip = Proc.new do |name, migration| -- cgit v1.2.3