2017-08-12 08:32:15 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-16 06:20:22 -04:00
|
|
|
namespace :active_storage do
|
2018-05-28 12:09:38 -04:00
|
|
|
# Prevent migration installation task from showing up twice.
|
|
|
|
Rake::Task["install:migrations"].clear_comments
|
|
|
|
|
2017-07-06 07:58:43 -04:00
|
|
|
desc "Copy over the migration needed to the application"
|
2017-08-08 10:47:38 -04:00
|
|
|
task install: :environment do
|
2017-12-10 22:24:11 -05:00
|
|
|
if Rake::Task.task_defined?("active_storage:install:migrations")
|
|
|
|
Rake::Task["active_storage:install:migrations"].invoke
|
|
|
|
else
|
|
|
|
Rake::Task["app:active_storage:install:migrations"].invoke
|
|
|
|
end
|
2017-07-06 07:58:43 -04:00
|
|
|
end
|
2018-07-22 20:33:25 -04:00
|
|
|
|
|
|
|
# desc "Copy over the migrations needed to the application upgrading"
|
|
|
|
task update: :environment do
|
|
|
|
ENV["MIGRATIONS_PATH"] = "db/update_migrate"
|
|
|
|
|
|
|
|
Rake::Task["active_storage:install"].invoke
|
|
|
|
end
|
2017-07-06 07:58:43 -04:00
|
|
|
end
|