Right in the introduction of the Phinx, we face the following reflection:
Good Developers Always version their code using a SCM system, so Why
don’t they do the same for their database schema?
Thinking that the philosophy of the application is to keep the database versioning, then the files migration
should be versioned, since this ensures the traceability changes in the database.
As for the configuration file, I assume you refer to the file that has the paths, Nvironments, right? If not, please comment that if I know I will edit. Unfortunately I don’t have the reputation to comment on your question yet, so I can’t resolve that doubt before I formulate the answer.
Anyway, assuming this is the quoted configuration file, yes, this file can go to git. However, this file contains information such as a database password that may compromise your security if another individual has access, so, as mentioned in the Docs, we must be careful not to become public, even more the application in production.
If you have more than one developer working on the application, or when you need to have separate environments for separate purposes (branchs, tests, etc.) we should use the environment variable PHINX_ENVIRONMENT
to replace the default environment. For more information about this, check more here.
As far as I can remember, these random numbers are a timestamp (maybe even the date and time itself, like 202005202009). This number is used only to sort which Migration is the newest. In the more the answer from Lucas is very clear.
– gmsantos