How should I maintain databases?

105 views Asked by At

Recently I've been familiar with version control (bithbucket), and I've uploaded all my projects on it. So I'm not concern about losing them anymore, even when my local hard drive dies. Because they are safe on bithbucket.

Ok, all fine. Now I'm looking for an approach to do the same thing for databases (both structure and data). Based on some searches, I figured out there is something named migrations which almost does what I want. But not really, I don't use any framework (like Laravel which supports migrations). Besides that, a migration contains only database's structure, not the whole data.

Anyway, is there any way to I also commit my databases on bitbucket? Or any approach similar?

1

There are 1 answers

2
VonC On BEST ANSWER

Git is well-suited for text data, not for database data (which contain 'blob', potentially binaries)

You could use git for the schema (as shown here), but for database objects, you need a dedicated tool (see this list), and a backup strategy which does not involve Git.