Pavel Koryagin
Pavel Koryagin

Reputation: 1491

Git and DB state

Git is excellent tool: you could switch to the one of previous versions and bisect the history to locate the bug.

But actually you could not, because when you're switching to the old release, your DB remains in its most recent state, so your Web app won't work at all.

Is there any common solution on how to work around that?

Some thoughts:

Upvotes: 2

Views: 66

Answers (2)

Arelis_xzx
Arelis_xzx

Reputation: 69

try this tool

https://hub.docker.com/r/arelis/gitdb

its a version control to mysql and use git for control version

Upvotes: 1

ThiefMaster
ThiefMaster

Reputation: 318778

The cleanest solution would be having a script that creates a database with dummy/testing data. Since this script and your database structure would be versioned, it would always create the correct one.

However, you cannot automatically perform a back-migration since the information about structure changes happening after the current commit are not available.

Upvotes: 1

Related Questions