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

Merge in 'builtin' backend to 4.x #714

Merged
merged 191 commits into from
May 3, 2024
Merged

Merge in 'builtin' backend to 4.x #714

merged 191 commits into from
May 3, 2024

Conversation

markstory
Copy link
Member

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

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.
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.
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.
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.
@markstory markstory added this to the 4.x (CakePHP 5) milestone May 2, 2024
@markstory markstory merged commit fa055cc into 4.x May 3, 2024
9 checks passed
@markstory markstory deleted the no-phinx branch May 3, 2024 03:23
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

Successfully merging this pull request may close these issues.

3 participants