Skip to content

Commit

Permalink
Merge pull request #4972 from solidusio/backport/v3.2/pr-4957
Browse files Browse the repository at this point in the history
[v3.2] Copy new migrations as part of the update task
  • Loading branch information
waiting-for-dev authored Mar 9, 2023
2 parents 5769b6a + 8e2d8d3 commit 64891b2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/lib/generators/solidus/update/update_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Solidus
class UpdateGenerator < ::Rails::Generators::Base
FROM = Spree.previous_solidus_minor_version

desc 'Generates a new initializer to preview the new defaults for current Solidus version'
desc 'Generates a new initializer to preview the new defaults for current Solidus version and copy new migrations'

source_root File.expand_path('templates', __dir__)

Expand Down Expand Up @@ -40,7 +40,7 @@ class UpdateGenerator < ::Rails::Generators::Base
def create_new_defaults_initializer
previous_version_prompt = options[:previous_version_prompt]
return if previous_version_prompt && !yes?(<<~MSG, :red)
The update process is only supported if you are coming from version #{FROM}. If this is not the case, please, skip it and update your application to use Solidus #{FROM} before retrying.
The default preferences update process is only supported if you are coming from version #{FROM}. If this is not the case, please, skip it and update your application to use Solidus #{FROM} before retrying.
If you are confident you want to upgrade from a previous version, you must rerun the generator with the "--from={OLD_VERSION}" argument.
Are you sure you want to continue? (y/N)
MSG
Expand All @@ -57,6 +57,11 @@ def create_new_defaults_initializer
File.join(options[:initializer_directory], "#{options[:initializer_basename]}.rb")
end

def install_migrations
say_status :copying, "migrations"
rake 'spree:install:migrations'
end

def print_message
say <<~MSG
Expand Down

0 comments on commit 64891b2

Please sign in to comment.