Skip to content
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

Handle the branch switching issue on migration #6

Closed
pabloelcolombiano opened this issue May 12, 2020 · 3 comments
Closed

Handle the branch switching issue on migration #6

pabloelcolombiano opened this issue May 12, 2020 · 3 comments

Comments

@pabloelcolombiano
Copy link
Collaborator

Since the FixtureManager truncates all tables excluding phinxlog, the schema needs to be updatable after switching to a different git branch.

One possibility is to add the option (somewhere to be defined) to truncate the phinxlog as well, so the schema may be rebuild from scratch.

This issue is the same for the test DB as well as for the normal DB. We could search for a general solution to rollback / migrate the migrations from one branch to the other.

@pabloelcolombiano
Copy link
Collaborator Author

This describes the problem in Cake:
cakephp/phinx#206

This is a solution for Laravel:
https://github.com/gilbitron/laravel-migrate-to-branch

@pakacuda
Copy link
Collaborator

the laravel solution is for the application's database, not the test database from what I understand. We should focus on the test database.
Just deleting all tables and running all the migrations on an empty database is enough at the beginning of the test suite IMO.

@pabloelcolombiano
Copy link
Collaborator Author

pabloelcolombiano commented May 25, 2020

The Migrator now handles the problem of migrations "up" and "missing".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants