Skip to content

Commit f048745

Browse files
authored
Merge pull request rails#54552 from fatkodima/fix-skip-kamal-database_yml-generation
Fix generating `database.yml` when skipping Kamal
2 parents d6bd069 + 9d63b05 commit f048745

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

railties/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ production:
4141
<<: *default
4242
# database: path/to/persistent/storage/production_cache.sqlite3
4343
migrations_paths: db/cache_migrate
44+
queue:
45+
<<: *default
46+
# database: path/to/persistent/storage/production_queue.sqlite3
47+
migrations_paths: db/queue_migrate
48+
<%- unless options.skip_action_cable? -%>
49+
cable:
50+
<<: *default
51+
# database: path/to/persistent/storage/production_cable.sqlite3
52+
migrations_paths: db/cable_migrate
53+
<%- end -%>
4454
<%- end -%>
4555
<%- else -%>
4656
# Store production database in the storage/ directory, which by default

railties/test/generators/app_generator_test.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,16 @@ def test_kamal_files_are_skipped_if_required
698698
assert_no_file ".kamal/secrets"
699699
end
700700

701+
def test_database_yml_skip_kamal
702+
run_generator [destination_root, "--skip-kamal"]
703+
704+
assert_file("config/database.yml") do |content|
705+
assert_match("db/queue_migrate", content)
706+
assert_match("db/cache_migrate", content)
707+
assert_match("db/cable_migrate", content)
708+
end
709+
end
710+
701711
def test_inclusion_of_kamal_storage_volume
702712
generator [destination_root]
703713
run_generator_instance

0 commit comments

Comments
 (0)