-
-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Database migrations with phinx and schema.sql generation #111
Comments
No, but you can do it in your code base if it make sense to your workflow.
Yes
Yes
Yes, and you should also generate and commit the (phinx) migration(s) in that branch. After you have merged that branch into master/main, you also generate/commit a fresh schema.sql file in master/main that reflects the current database schema.
Yes
When you deploy with Github you may execute these commands via SSH. |
What do you mean by code base?
Okay, let's say I pull from |
The source code of your project/s.
Yes, when you fetch the latest changes from master, then you also need to update your local dev database to the latest database version by executing the new migrations. |
@samuelgfeller maybe you could have it in a post update git hook ? an example of a hook I used to use that checked for composer.lock updates and ran composer install if needed
Alternatively you could have a run configuration in your IDE that makes it easy to click to run it |
@dunkoh thank you for the input! |
For context, the conversation started in this commit.
I have to update that schema.sql if it doesn't match the current state of my dev db for the tests to not fail. I can do this with
composer schema:generate
.Is there a way to execute this command automatically, ideal would be once before any test and then not again while tests are running? (especially when running tests from IDE)
And regarding migrations workflow, is that correct?:
composer migrate
on the remote server so that its database gets updated when deploying with GitHub actions?The text was updated successfully, but these errors were encountered: