-
Notifications
You must be signed in to change notification settings - Fork 120
Add --fake flag to seeds run and --seed option to seeds reset #985
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
base: 5.x
Are you sure you want to change the base?
Conversation
0a5febc to
b9227fd
Compare
- 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
src/Migration/Manager.php
Outdated
| if (!$seed->isIdempotent()) { | ||
| $executedTime = date('Y-m-d H:i:s'); | ||
| $adapter->seedExecuted($seed, $executedTime); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this leave idempotent seeds as not faked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
|
Adjusted as per review. |
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.