-
Notifications
You must be signed in to change notification settings - Fork 1
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
RefreshDatabaseFast is seeding before migrating. #8
Comments
Please specify your issue more detailed, if you have further questions. For now I'm gonna close this issue... |
I believe this is in reference to RefreshDatabaseFast trait: /**
* Check if migration fresh is necessary by checking
* if the migrations files checksum has changed.
*/
protected function runMigrationsIfNecessary(): void
{
if (! $this->identicalChecksum()) {
if (config('useful-additions.refresh_db_fast.seed')) {
$this->seed();
}
$this->artisan('migrate:fresh', $this->migrateFreshUsing());
//create checksum after migration finishes
$this->createChecksum();
}
} I'm not using this feature, but also noticed this while reading the code for another issue. |
I too have come across this issue - but I am using the feature.
There is a check to see if the migrations need to run based on the checksum. With the config, you can have it seed too. However, the code seeds and then does a migrate fresh which effectively wipes out the seed. The seed should come after the migrate. See comment above for code block which I'm referring to. |
I'm submitted a pull request to fix this #18 |
I couldn't figure out why seeding was not working, but in the runMigrationsIfNecessary method of the Trait, you are first seeding (upon checking the configuration parameter, that's correct) but then you're doing a migrate fresh completely emptying the seeding :)
The text was updated successfully, but these errors were encountered: