As I reported at rails/rails#34710 (comment), rails db:system:change command fails only via spring.
% rails db:system:change --to=postgresql
Running via Spring preloader in process 15906
invalid option: --to=postgresql
Probably due to the following spring update.
b85f41b
This forces to call rake for all db commands, but exceptionally the new db:system:change command is not a rake task.
% rake db:system:change --to=postgresql
invalid option: --to=postgresql
The following simple fix works fine in my environment.
How about this fix?
elsif command_name&.start_with?("db:") && !command_name.start_with?("db:system")