rails / solid_cache

A database-backed ActiveSupport::Cache::Store
MIT License
890 stars 63 forks source link

dedicated cache database not created with steps from readme #150

Closed vokshirg closed 9 months ago

vokshirg commented 9 months ago

When I follow steps from here to create dedicated cache database, I run command rails db:create but get only response that my dev database already exists. And cache_development has not been created

# database.yml
default: &default
  adapter: postgresql
  encoding: unicode
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  url: <%= ENV["DATABASE_URL"] %>

development:
  <<: *default
  database: my_app_development
  cache:
    database: cache_development
    url: <%= ENV["DATABASE_URL"] %>
    migrations_paths: "db/cache/migrate"

what am i missing? I'm using postgresql, does it supported with this syntax?

vokshirg commented 9 months ago

oh, my bad, that works 🙈

development:
  primary:
    <<: *default
    database: my_app_development
  cache:
    database: cache_development
    url: <%= ENV["DATABASE_URL"] %>
    migrations_paths: "db/cache/migrate"