Skip to content

Better dev#10

Merged
jason-raitz merged 5 commits intomainfrom
better-dev
Mar 31, 2025
Merged

Better dev#10
jason-raitz merged 5 commits intomainfrom
better-dev

Conversation

@jason-raitz
Copy link
Copy Markdown
Contributor

  • updated readme with docker dev instructions
  • added a backup of the db to load on dev
    (there are some permissible errors when loading the data)

 - updated readme with docker dev instructions
 - added a backup of the db to load on dev
   (there are some permissible errors when loading the data)
@jason-raitz
Copy link
Copy Markdown
Contributor Author

@anarchivist @danschmidt5189

For a better development experience when working with Galc-ui, I've added in a dump from prod. Below is the ERD for the DB. There is no user data in the dump. quick list of tabes: closures, schema_migrations, ar_internal_metadata, images, items, facets, terms, items_terms. Is this okay?

ERD

@danschmidt5189
Copy link
Copy Markdown
Member

I like the idea of providing bootstrapping / seed data. My concern is that we ought to be using Rails seeds for this rather than a DB dump, because:

  1. Dumps can interfere with the developer experience around Rails migrations / seeding.
  2. Dumps add additional out-of-band maintenance overhead.
  3. There's not enough data to warrant using a dump for performance reasons.

So tl;dr I think we're better off using seeds here, either by converting the running database to seeds using a gem like seed_dump or creating synthetic data with ActiveRecord and a gem like faker.

@dmolesUC
Copy link
Copy Markdown
Contributor

FWIW, because they were also used to import/convert data from old GALC, the existing database migrations also provide a fully populated database (as of its December 2022 state, which of course doesn't include current Terms or more recently added Items). Not very performant, and maybe not the best design decision I could have made at the time, I admit. Generating seeds.rb does seem like the more Rails-y, least-surprise way to do it.

@anarchivist
Copy link
Copy Markdown
Member

agreed with the seeds comments here, so let's go that direction. 🌱

@jason-raitz
Copy link
Copy Markdown
Contributor Author

@dmolesUC You were right. The way I was running the db setup wasn't loading in the migration data. For now, I'll remove the sql dump and change the readme to reflect a better dev workflow.

@jason-raitz jason-raitz merged commit 4461ef1 into main Mar 31, 2025
8 checks passed
@jason-raitz jason-raitz deleted the better-dev branch March 31, 2025 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants