Answer the question
In order to leave comments, you need to log in
Development is underway in the git repository, how to keep the sql structure up to date?
There are four developers. Everyone can add new tables to the database. There is a Codeception testing system. Not all developers run tests. Dumps are made by hand. The repository accumulates a lot of dumps. How to keep sql structure up to date? How to automate the process?
Answer the question
In order to leave comments, you need to log in
Migrations. Every database change is a migration. No manual changes in the structure of the database, we wrote a migration, wrote up / down it and rolled forward and if something rolled back. Also, the initial database dump can be done as the first version. That is, the base from scratch should be deployed by migrations.
https://github.com/robmorgan/phinx - I recommend this implementation.
It is also worth implementing changes to the database so that the new version does not break the old one. You don't just need to delete fields from a database or table. Only if there is no way without it. This will allow you to automate the deployment process with rollback later, but you will have to start thinking when designing the database.
do you get files in *.sql format? if so, then they seem to have in the text version queries for creating tables and inserting data. what prevents to place it in the repository and change the lines by agreement?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question