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

[10.x] Add Support for SaveQuietly and Upsert with UUID/ULID Primary Keys #46161

Merged
merged 3 commits into from
Mar 3, 2023
Merged

[10.x] Add Support for SaveQuietly and Upsert with UUID/ULID Primary Keys #46161

merged 3 commits into from
Mar 3, 2023

Conversation

TFSThiagoBR98
Copy link
Contributor

Currently, the framework sets the unique ids before saving via the 'creating' event, however this does not work when trying to use saveQuietly which ignores all events or upsert which does not fire the 'creating' event, this PR changes it to not use events but be called directly in the performInsert and upsert methods, as it is done to set timestamp values.

Add some tests for this use case.

Related #44430

@TFSThiagoBR98 TFSThiagoBR98 changed the title Add Support for SaveQuietly and Upsert with UUID/ULID Primary Keys [10.xAdd Support for SaveQuietly and Upsert with UUID/ULID Primary Keys Feb 17, 2023
@TFSThiagoBR98 TFSThiagoBR98 changed the title [10.xAdd Support for SaveQuietly and Upsert with UUID/ULID Primary Keys [10.x] Add Support for SaveQuietly and Upsert with UUID/ULID Primary Keys Feb 17, 2023
@taylorotwell taylorotwell merged commit 664c5d6 into laravel:10.x Mar 3, 2023
@joelharkes
Copy link
Contributor

The uuids are set later now in the events loop, i don't understand how this is not seen as a breaking change?

@TFSThiagoBR98
Copy link
Contributor Author

TFSThiagoBR98 commented Mar 28, 2023

@joelharkes Good point, I'll send a PR to move the setUniqueIds to before the creating event

TFSThiagoBR98 added a commit to TFSThiagoBR98/framework that referenced this pull request Mar 29, 2023
taylorotwell pushed a commit that referenced this pull request Mar 29, 2023
* Move SetUniqueIds to run before the creating event

This fixes a BC caused by PR #46161

* Update Model.php
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