DEV Community

Discussion on: How do you plan your database in development, before migrating to production?

Collapse
 
ronald_arias profile image
Ron

My approach is to use Docker to run an instance of my database server locally.
The idea is to keep my local and prod DBs in sync, but for the local one to be easily destroyed and recreated.
For this I use schema migrations. I've created a project in which I leverage ActiveRecord migrations to keep my DBs in sync (whether they belong to ruby apps or not).
That way I can go up or down in specific changes, both in prod and dev, or simply redo my local one. You could do the prod one as well, but not recommended.

Hope it helps