-
Notifications
You must be signed in to change notification settings - Fork 116
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
4.next merge to 4.x #771
Merged
4.next merge to 4.x #771
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Port cakephp/phinx#2301 to migrations. Fixes #737
Port insert & bulkinsert compatibility from phinx
merge 4.x => 4.next
These are important interfaces for userland code. All of the current migrations extend from phinx base classes. I'd like to try updating migrations internals by doing the following changes - [ ] Add SeedInterface and MigrationInterface. - [ ] Add decorator that adapts between phinx and migrations. Manager::getSeeds(), getMigrations() - [ ] Move phinx shims into adapter/decorator - [ ] Update the internals to use migrations interfaces. - [ ] Introduce a new base class that is all migrations - [ ] Provide upgrade tool to update migration classes. If all goes well, we'll have an opt-in path for applications to upgrade to the new namespaces and code before a breaking change where phinx compatibility is removed.
Start to add Migrations versions of base interfaces
- Add methods that will allow symfony support to be dropped in the next major - Add better intergration with CakePHP abstractions. - Put some TODOs in for the next set of changes.
4.next - Revise the migrations interfaces
Update the internals of Manager and Environment to use Migrations interfaces for Seeds. This pushes the compatibility shims down a layer and should continue to give the same backwards compatibility. Next I'll build a BaseSeed that is all migrations internals.
Add and use a ShimAdapter
Start adapting the internals for Migrations to not rely on phinx. Like seeds, there will be a wrapping adapter to shim the behavior up.
Migrations adapter
Most but not all. I've only included the methods we're currently relying on in migrations. This is another step towards decoupling from phinx for the new backend.
it isn't used internally and I don't see a reason to maintain it.
It is unused internally.
I won't be able to fully refactor it away. There are conventions for migration files that Inflector does not replicate.
The test stubs for Util don't need to adhere to coding standards as they contain migration files from phinx.
Import most of Phinx\Util\Util
Reduce phinx usage and stabilize backend inteface
This class will be the new base class for Migrations that are compatible with only the built-in backend. This gives a opt-in flow to having a fully compatible migration set before the breaking change is done. * Fix up table() interface and add integration test * Expand coverage with an integration test. * Add another assertion * Fix usage of keywords
* Add documentation blocks * Add missing default value. * Add integration test for BaseMigration migrations * Add BaseMigration * Rename migrations to not conflict * Import logic from Migrations\Table. We'll need to keep compatibility with these methods as well. * Consolidate test stubs. One migration should be enough to do the integration testing I want * Fix failing tests. * Fix broken behavior in addPrimaryKey() * Improve test assertions * Update mysql collation to current defaults * Fix psalm
* Update seed generation to use new base classes When the new builtin backend is in use, generated seeds should use the new backend. * Update migrations generation to use builtin backend When enabled, bake migration should use migrations base classes for new migrations.
I've adapted the content slightly to reflect current state of migrations more. * Update docs link in generated code * Update docs links for seeds with new base class * Update more snapshots. * Update sqlserver snapshots
Leaving tables behind isn't very nice.
Update Bake migration diff to generate with builtin base classes
Enable builtin backend tests for migration_diff as well
- Update postgres, sqlserver and sqlite fixtures - Fix phpstan - Update todos and doc blocks
4.5 - Update bake migration snapshot for builtin backend
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think this is in a good enough shape to release as 4.5.0. This release will include: