-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Installation: db:prepare with pre-created databases #45
Comments
confirming I bumped into the same issue - the solution / workaround helped me. Thx. |
Confirming I faced the same issue and this workaround worked for me, thanks. |
I'm experiencing similar issues when setting up solid_cable. Specifically, the command In my case, I have only the development environment set up for solid_cable with the following configuration: development:
primary:
<<: *default
database: myapp_development
cable:
<<: *default
migrations_paths: db/cable_migrate
database: myapp_development_cable
test:
primary:
<<: *default
database: myapp_test Attempting to run bin/rails aborted!
TypeError: Invalid type for configuration. Expected Symbol, String, or Hash. Got nil (TypeError)
raise TypeError, "Invalid type for configuration. Expected Symbol, String, or Hash. Got #{config.inspect}"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Tasks: TOP => db:schema:load:cable => db:test:purge:cable
(See full trace by running task with --trace) From what I can see in # desc "Empty the #{name} test database"
namespace :purge do
task name => %w(load_config check_protected_environments) do
ActiveRecord::Tasks::DatabaseTasks.with_temporary_pool_for_each(env: "test", name: name) do |pool|
db_config = pool.db_config
ActiveRecord::Tasks::DatabaseTasks.purge(db_config)
end
end
end I'm wondering if it's necessary to define test environment entries in development:
adapter: solid_cable
connects_to:
database:
writing: cable
polling_interval: 0.5.seconds
message_retention: 1.day
test:
adapter: test Of course, the same behavior occurs across all |
Happy to take any updates to the readme for this but it sounds like a test db wasnt being configured for cable. bin/rails db:schema:load:cable should do the trick. |
I just deployed solid_cable (latest) to production and hit a few problems. The largest of which was this this from the README:
db:prepare
will only execute if the database doesn't exist.Problem
For those who use managed databases, the DB is pre-created and the path forward isn't clear.
So I had an empty solid_cable DB with no tables causing app failures.
Failed Solution
I tried
bin/rails db:schema:load:cable
which errored out with:which I didn't investigate unfortunately.
Solution
Copying
db/cable_schema.rb
to a migration indb/cable_migrate
resolved the issue for me.I'm not sure if this was the best path to resolution but I wanted to point out the obstacle that likely others will hit.
BTW the same problem scenario exists for solid_cache.
The text was updated successfully, but these errors were encountered: