Firstly I'm only discussing my development database (development.sqlite3).
I have recently just realised that by default the database is not under version control (after creating a model and switching branches and trying to create that same model - I was redoing a tutorial - I got an error stating that it already existed). I checked my .gitignore file that was created by default and indeed it was not under version control.
# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal
I find this somewhat annoying and actually worrying that it's not under version control however I'm sure this default behaviour is done with good reason.
Why is the database not under version control?
Similarly is it a bad idea if I was to do so? (Although I agree it will be massively annoying to keep committing the database to git after new CRUD to the database are done).
How would I go about doing this? - I would've thought it was nice to be able to switch branches (not the master) and alter the model and know that when I return to the master branch and know that I haven't broken anything (if I haven't merged of course).