Skip to content

Stop using deprecated setOnDelete/setOnUpdate methods#1047

Merged
dereuromark merged 1 commit into5.xfrom
fix/deprecated-foreign-key-methods
Mar 11, 2026
Merged

Stop using deprecated setOnDelete/setOnUpdate methods#1047
dereuromark merged 1 commit into5.xfrom
fix/deprecated-foreign-key-methods

Conversation

@dereuromark
Copy link
Member

Summary

  • Update bake templates (add-foreign-keys.twig, change-method-body.twig) to use setDelete() and setUpdate() instead of the deprecated setOnDelete() and setOnUpdate() methods
  • Update ForeignKey::setOptions() to directly set properties instead of calling deprecated methods
  • Update test comparison files to reflect the new method names
  • Update TableTest to use setOptions() instead of deprecated methods

Fixes #1045

Update bake templates and internal code to use the non-deprecated
setDelete() and setUpdate() methods instead of the deprecated
setOnDelete() and setOnUpdate() methods.

Fixes #1045
@LordSimal
Copy link
Contributor

Can confirm - with this change the generated snapshot does not contain any deprecated methods anymore 🥳

@dereuromark dereuromark merged commit 273b420 into 5.x Mar 11, 2026
14 checks passed
@dereuromark dereuromark deleted the fix/deprecated-foreign-key-methods branch March 11, 2026 20:13
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.

bin/cake bake migration_snapshot generates deprecated code

2 participants