I frequently write code changes (PHP) that go along with a schema change. This requires a few steps:
- Develop the new code, adding new columns as needed.
- Add new columns or change schema on live.
- Deploy new code on live.
- Migrate data from old columns to new columns, if required.
- Delete old columns.
Is there an easy way to do this with git?
What if more than one of these sequences need to be done? That complicates using the same file for changes, as the second commit would开发者_开发技巧 wipe out the changes for the first.
Help! :D
You might find this tool helpful: https://github.com/ruckus/ruckusing-migrations
There is a product called DeltaSQL, you might try it out. It is a great tool for version tracking SQL.
精彩评论