Skip to main content
12 events
when toggle format what by license comment
Apr 21, 2022 at 22:28 comment added SebasSBM I landed into this question because a doubt I have about my own project: (and IDK if it's worth opening a new question)... I have an app which comes with a pre-populated database in SQLite (so the whole DB is actually one single file)... I was wondering (in terms of code mantainance/documentation)... is it worth to include it in Git commits? (I mean, surely it's a binary file; and I don't think it is that important for the code's repository and mantainance to keep it... even though I will release it as a Beta version... but I'm not sure what to think about it though...)
Sep 27, 2019 at 11:50 comment added mechalynx Slightly annoyed at the lack of understanding on why we don't version binary files (and pretty much every active db is a binary, for efficiency). Short answer: they don't change in the clean way source files do, thus making it inefficient to maintain a long list of patches. If you want to version a database schema and can't be bothered to do a manual dump, use git hooks (or hooks in your favorite vcs) to have it automatically request a schema dump from the db server. Then you'd have something consistent your vcs can diff.
Apr 29, 2019 at 7:49 comment added Tails Check the 'time-travel' feature of the Flur.ee (flur.ee/index.html) database. It was built for blockchain, so the diff-like increments in the data model have been a fundamental part of its design.
May 16, 2018 at 17:35 comment added Gregory Arenius Do be aware that if you have Foreign Data Wrapper connections with passwords that those passwords are stored in the schema. So if you put the dump in version control those passwords end up in version control.
Feb 26, 2018 at 15:51 comment added ericksho you can use doctrine or a versioning system like Liquibase, those store the model in xml, php or another text file that can be versioned
Sep 21, 2015 at 16:18 comment added Áxel Costas Pena I'm sure there is any tool to get the DDL from the PostGreSQL... that is what you must put on your VCS
Feb 14, 2010 at 21:59 vote accept hasen
Nov 27, 2009 at 23:57 vote accept hasen
Feb 14, 2010 at 21:57
May 11, 2009 at 5:55 comment added Dana the Sane This type of solution is pretty standard and the schema is actually source code.
May 11, 2009 at 5:34 comment added hasen Hmm, I see! Well, are there db systems that are more git-friendly?
May 11, 2009 at 4:28 comment added X-Istence PostGreSQL database files are binary files, feel free to put them in your git repository, you just won't be able to do any diffs on them, and any changes will most likely change the whole database and thus you now have to send the full database over the wire to your git repo and store it. This is inefficient, slow, and makes it extremely hard to work with. Also, I am not sure that the database files stored on disk without VACUUM and shutting PostgreSQL down to make a copy are "stable" as in all of the data is always correct, thereby possibly leaving you with corrupt data.
May 11, 2009 at 3:52 history answered X-Istence CC BY-SA 2.5