Skip to content

Commit 2d01da8

Browse files
authored
Merge pull request rails#46086 from skipkayhil/fix-force-db-change
Fix being able to pass --force to db:system:change
2 parents ae5cf96 + 25c468b commit 2d01da8

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

railties/lib/rails/commands/db/system/change/change_command.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def initialize(positional_args, option_args, *)
1515
super
1616
end
1717

18-
def perform
18+
def perform(*)
1919
Rails::Generators::Db::System::ChangeGenerator.start(@argv)
2020
end
2121
end

railties/test/commands/db_system_change_test.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ class Rails::Command::Db::System::ChangeCommandTest < ActiveSupport::TestCase
5454
assert_match "gsub Gemfile", output
5555
end
5656

57+
test "change can be forced" do
58+
output = `cd #{app_path}; bin/rails db:system:change --to=postgresql --force`
59+
60+
assert_match "force config/database.yml", output
61+
assert_match "gsub Gemfile", output
62+
end
63+
5764
private
5865
def change_database(to:, **options)
5966
args = ["--to", to]

0 commit comments

Comments
 (0)