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

4.next merge to 4.x #771

Merged
merged 62 commits into from
Nov 24, 2024
Merged

4.next merge to 4.x #771

merged 62 commits into from
Nov 24, 2024

Conversation

markstory
Copy link
Member

I think this is in a good enough shape to release as 4.5.0. This release will include:

  • New base classes for migrations and seeds that default to the built-in backend.
  • Updated bake commands to use new base classes.

markstory and others added 30 commits September 2, 2024 23:58
Port insert & bulkinsert compatibility from phinx
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.
Start adapting the internals for Migrations to not rely on phinx. Like
seeds, there will be a wrapping adapter to shim the behavior up.
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
@markstory markstory merged commit 32afa21 into 4.x Nov 24, 2024
16 checks passed
@markstory markstory deleted the 4.next branch November 24, 2024 03:11
@markstory markstory restored the 4.next branch November 24, 2024 03:12
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.

2 participants