DEV Community

Sushant Bajracharya
Sushant Bajracharya

Posted on • Edited on

2

How you guys handle database versioning?

Working on a large app with tons of developers and branches can quickly lead up to polluting your database with unnecessary columns from the migration that you ran from your co worker's branch or your own feature branch that is not merged in the master yet.

The solution could be to go back to your co worker's branch and rollback the damn migration but we are only human beings.

It would have been nice if the database could change with
git checkout -b <new branch>

and remember the old database with git checkout <old branch>

So, what do you guys use to tackle such issues?

Update 1

For now, I am writing a bash script that will create a database per branch. https://github.com/sushant12/gla

Update 2

So, I just finished writing the script and it is working fine. I will be testing the script with my co-worker on our project at work. Till then you guys can try this at your own risk: https://github.com/sushant12/gla

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay