Search code examples
databasegitpostgresqlversion-control

Postgresql Database Version Control and tracking


I'm working on Postgresql and I need to frequently make changes to the data and switch between database versions.

I used to make a virtual machine and use the snapshot feature but it's slow and consumes much storage space.

Is there a way to use git for tracking database changes?

What I tried: I searched until I found where postgresql stores its database files and created a git repo but without success.

I also found a software dedicated for this purpose but it didn't work either.


Solution

  • i think you must use liquibase

    please check this

    Liquibase is an open-source database schema change management solution which enables you to manage revisions of your database changes easily. Liquibase makes it easy for anyone involved in the application release process to:

    1. Eliminate errors and delays when releasing databases.
    2. Deploy and roll back changes for specific versions without needing to know what has already been deployed.
    3. Deploy database and application changes together so they always stay in sync.