You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If your application is adding solid_cache and you have config.active_record.schema_format = :sql set, should the cache_schema.rb file be generated?
I was under the impression that you would not since:
the application's database does not have a corresonding schema.rb
the database.yml files specify a migrations_path which is where you would add the migration to create the solid_cache_entries table, not via the cache_schema.rb file.
db:seed Gets run twice
The reason I bring this up is that if for some reason a developer follows these steps, the db:seed task will be run a 2nd time on the application's database. Here are the steps to reproduce:
rails new solid-cache-app --database=postgresql
rails g model Dog. Add a name attribute to the dog and add this to the seeds.rb file Dog.create(name: "Fido")
Set config.active_record.schema_format = :sql in application.rb
Run rails db:prepare
add cache database steps
Update the database.yml file to include the cache database
I can't tell if Rails main has the fix or not but at any rate, maybe there's still some clarification of the README that could be done for those that use config.active_record.schema_format = :sql.
If your application is adding solid_cache and you have
config.active_record.schema_format = :sql
set, should the cache_schema.rb file be generated?I was under the impression that you would not since:
migrations_path
which is where you would add the migration to create thesolid_cache_entries
table, not via the cache_schema.rb file.db:seed
Gets run twiceThe reason I bring this up is that if for some reason a developer follows these steps, the
db:seed
task will be run a 2nd time on the application's database. Here are the steps to reproduce:rails new solid-cache-app --database=postgresql
rails g model Dog
. Add aname
attribute to the dog and add this to the seeds.rb fileDog.create(name: "Fido")
config.active_record.schema_format = :sql
in application.rbrails db:prepare
add cache database steps
cache_schema.rb
file because of the reasons mentioned above.rails db:prepare
.Expect the seed file to not have run on the primary database
Actual results: Seed file was run on primary database and you now have two dogs named Fido.
Environment
Rails version: 8.0.1
solid_cache version: 1.0.6
Ruby version: 3.4.1
The text was updated successfully, but these errors were encountered: