Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does it make sense to store a SQLite database in version control?

I'm exploring the option of using SQLite as a database to store resources (mostly key value pairs) that are only necessary during the development process. This database would never be accessed directly in production or any other environment. A custom application would be used to generate multiple static resources based off the content in this database. I would like to keep a history of changes to this database, so storing in version control seems like a good idea since I would get that for free.

My question is would this make sense using SQLite? Or is there a more appropriate alternative?

like image 958
Ben Harrison Avatar asked Jan 14 '14 18:01

Ben Harrison


1 Answers

Instead of storing the binary file for the SQLite database you should store the source material - either some XML/CSV/... file, or SQL file containing the insert statements.

This way you will get proper support for merging and viewing history/comparing (which does not really work for binary files, only text files).

like image 140
Knaģis Avatar answered Oct 16 '22 13:10

Knaģis