DEV Community

Bruno Louzada
Bruno Louzada

Posted on

How do you setup local development database?

Hi dev's, it's my first post on dev.to, we are facing some problems with local development in my office, and a bad local development environment is a root of so many problems, like too often broken test environment, the first problem is the database, we have spring boot with flyway migrations that setup some tables in the local database, but the tables are empty or in some occasions don't exist, I'm studying hard some things to get local development 100% I'm open to discuss with you about it. Thanks!

Top comments (2)

Collapse
 
buphmin profile image
buphmin

I like to use docker and a sql script for populating minimum dev data when possible. This can help prevent the "works on my machine" part by making sure everyone is using the same config across all environments.

For acceptance testing I use Codeception with gherkin to populate tables with testable values as needed.

You can take a look at my Symfony 4 demo repo for an idea of how to configure docker with a sql script to populate the DB. The DockerFile-db imports the dump.sql stored in the dockerConfig dir. The dump.sql contains the schema and inserts some data.

Collapse
 
blouzada profile image
Bruno Louzada

Wow sounds like a really good strategy I will take a look thank you