diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2017-07-06 13:58:43 +0200 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2017-07-06 13:58:47 +0200 |
commit | 6129a63764a0ac3c81d7876db5d9a55d1c5c963c (patch) | |
tree | 4c590405f760a0305e01c6d33b6833baf0ed362e /lib/tasks | |
parent | 7341d9100985b59d14afb804c71826d6617bba7e (diff) | |
download | rails-6129a63764a0ac3c81d7876db5d9a55d1c5c963c.tar.gz rails-6129a63764a0ac3c81d7876db5d9a55d1c5c963c.tar.bz2 rails-6129a63764a0ac3c81d7876db5d9a55d1c5c963c.zip |
Add task to install the migration needed
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/activestorage.rake | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/tasks/activestorage.rake b/lib/tasks/activestorage.rake new file mode 100644 index 0000000000..ff44958151 --- /dev/null +++ b/lib/tasks/activestorage.rake @@ -0,0 +1,12 @@ +require "fileutils" + +namespace :activestorage do + desc "Copy over the migration needed to the application" + task :migration do + FileUtils.cp \ + File.expand_path("../../active_storage/migration.rb", __FILE__), + Rails.root.join("db/migrate/#{Time.now.utc.strftime("%Y%m%d%H%M%S")}_active_storage_create_tables.rb") + + puts "Now run rails db:migrate to create the tables for Active Storage" + end +end |