I’m running a Rails 6 app with a config that looks this:
static_default can be thought of as a portable database that we check in to git. It rarely gets updated but some ActiveRecord objects live in there.
I’d like to disable it being affected when doing commands like
bin/rails db:migrate, etc. Has anyone had ways to make this work without overwriting rake tasks in
Sorry for deviating from the original question, but I wanted to mention that we are using
frozen_record for similar purpose - GitHub - byroot/frozen_record: Read only ActiveRecord-like interface to query static YAML files
you may want to consider switching to this
I haven’t used this yet but your question made me curious and it looks like there’s a config flag now in at least 7+ to ignore a DB from the regular tasks.
Anchor link to specific section in the Rails guides: Multiple Databases with Active Record — Ruby on Rails Guides
I think that’s what Shopify uses and that’s what we used at my previous company
I just wanted to say a big “thank you” for mentioning
frozen_record. Earlier this year I spent ages searching around for something like this and drew a blank.
frozen_record is exactly what I was looking for all along!