Add --fake flag to seeds run and --seed option to seeds reset#985
Merged
Add --fake flag to seeds run and --seed option to seeds reset#985
Conversation
LordSimal
approved these changes
Jan 3, 2026
0a5febc to
b9227fd
Compare
markstory
reviewed
Jan 5, 2026
- Add --fake flag to mark seeds as executed without running them - Add --seed option to seeds reset for selective seed reset - Both features mirror similar functionality in migrations
b9227fd to
910dc1d
Compare
markstory
reviewed
Jan 11, 2026
src/Migration/Manager.php
Outdated
Comment on lines
+574
to
+577
| if (!$seed->isIdempotent()) { | ||
| $executedTime = date('Y-m-d H:i:s'); | ||
| $adapter->seedExecuted($seed, $executedTime); | ||
| } |
Member
There was a problem hiding this comment.
Won't this leave idempotent seeds as not faked?
Member
Author
There was a problem hiding this comment.
This could indeed be a bit confusing:
- User runs seeds --fake expecting all seeds to be marked as executed
- Idempotent seeds appear to be "faked" (output says so) but nothing is actually recorded
- Next time they run seeds, the idempotent ones will run again (which might be fine for idempotent seeds, but the messaging is misleading)
The question is: what should the behavior be?
Option A: Keep current behavior but improve messaging - show "skipped (idempotent - not tracked)" instead of "faked" for idempotent seeds
Option B: Skip idempotent seeds entirely when using --fake (with appropriate messaging)
I would say A.
Member
There was a problem hiding this comment.
Option A works for me. I was concerned that the messaging we show developer didn't match the behavior. It is better now.
Idempotent seeds are not tracked, so faking them doesn't make sense. Instead of showing misleading "faking"/"faked" messages, now shows "skipped (idempotent)" to clarify what's happening.
Member
Author
|
Adjusted as per review. |
This file contains hidden or 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
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.
Summary
--fakeflag toseeds runcommand to mark seeds as executed without running them--seedoption toseeds resetcommand for selective seed resetNew features
Fake seeding:
Selective reset:
Both features mirror similar functionality available in migrations.