0

I'm using GitHub as a project repository, and whenever a contributor changes something in his local database, he sends an email with SQL statements after a pull request to inform all contributors that they must change database before merging the new code source changes.

For example, I can use an issue like this:

  1. Create an issue

  2. Reference this issue from commit by including the issue number inside of commit message. Example: git commit -m "last update, check #13"

Is there a better way to inform other contributors about SQL changes using Git?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Imanez
  • 500
  • 5
  • 13

1 Answers1

2

You need to bring your database into your repository. Emailing SQL statements around just means they'll get lost. What's the process for a new hire to initialise their database? It's tricky with your current methodology.

This will depend greatly on the language/frameworks/database type you're using.

In practice, it means you commit a series of migration scripts that apply changes to the database in sequential order.

At the most basic level they can be SQL files. If using a more robust tool you can get the option to rollback your changes, rebuild the database schema and so on.

Further reading:

Community
  • 1
  • 1
bcmcfc
  • 25,966
  • 29
  • 109
  • 181