Skip to content

Instantly share code, notes, and snippets.

View adriankremer's full-sized avatar
🦑
F.U.C.K.U.P.

Adrian Kremer adriankremer

🦑
F.U.C.K.U.P.
View GitHub Profile
@mneuhaus
mneuhaus / Idea.md
Created November 12, 2013 13:12
Database Data Versioning

Prolog

one issue that regularily occurs to me in a development project is how to keep in sync with the database. This is often no problem if you develop it yourself, alone. But if you're developing a project with more than one person the generally accepted best practice is to develop locally, commit changes and then deploy to the testing/staging/production. This is all and well with code of course. But keeping the database in sync is quite a hassle sometimes. Most systems provide at least schema-migrations or other means of analysing + patching the database. But what about the data itself? Currently there are 2-3 Scenarios that you could do:

  • develop locally and regularily dump the production database and import it locally
    • pro: fast project because everything is local and easily to develop
    • con: you regularily get out of sync and need to redo stuff manually or override the database
  • open up the production/staging database and let every local developer use that
  • pro: everyone uses the same dat