-
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
Merge in 'builtin' backend to 4.x #714
Merged
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
Import the Db/Table package from phinx and get the tests passing. My plan here is to import all of the 'data transfer' objects from phinx and get them referencing each other. Once that is complete, we'll need to import the Plan and Migration wrappers. This will form the core of the API compatibility with phinx. The adapter layer can be replaced by a mix of Cake's Database package and some more dialect style platform wrappers. Finally we'll need to provide the same CLI interface that migrations has always given.
Simple import of more files from phinx. Working towards having all of the necessary pieces in place before incrementally removing phinx adapter.
There are several static analysis errors right now as phinx's AdapterInterface does not accept our table objects. My plan is to make a similar adapter interface that is implemented with a mix of the Cake ORM and logic we import from phinx.
import more code to get MySQL adapter tests passing.
Fix errors and update the baseline
- Import sqlite driver code from phinx. - Update config parsing to use ConnectionManager as that is the eventual end state. - Fix strict errors caused by uninitialized properties.
Update baseline files
not all mysql instances use utf8mb4 as their default encoding.
Update baselines
Fix psalm and phpcs errors
I'm not sure the `datetimefractional` changes are correct as that isn't an abstract type. Phinx might be missing support for sqlserver datetime types.
This could break other driver tests though.
We can't remove precision on datetime columns as it impacts other drivers. phinx has inconsistent support for fractional datetimes that will need to be restored to enable more tests.
Migrations builtin backend
Instead of Phinx's feature flags we should use Configure. I've chosen to read and write directly to Configure to avoid more complexity. The additional default values in `Migrator` will improve compatibility with existing usage.
Convert FeatureFlags to Configure operations
Missing plugins should not silently succeed anymore.
Add test covering mark_migrated and plugins
This entry point command improves on the approach we used in `bake` to provide an entrypoint method that gives access to more help.
Add `migrations --help` command
Internal simple task objects feels like a more maintainable pattern than traits do.
There is no suitable class in CakePHP. The database layer uses `QueryExpression` to add raw SQL to specific query clauses, and thus has no way to represent a literal value without providing a broad type.
It was not implemented before via migrations and doesn't need to exist anymore.
We only ever operate on a single path in the new flow. The console arguments drive the migration configuration much more in the built-in implementation. The parameters have good defaults and can be customized, but there is no way to have more than one path presently.
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.
Merge in the 'builtin' backend to 4.x with the intent to release it. I've tried to keep the backwards incompatibility risk to a minimum, and the new backend is opt-in via a configure option.
With these changes released, I'm hoping to refactor the
Adapter
internals further to use the cake database layer better.Refs #647