FOUR-6887 Housekeeping: delete not necessary MigrateFresh class
ticket FOUR-6887
Issue & Reproduction Steps
In the past, a ProcessMaker\Console\Commands\MigrateFresh class was created to handle two databases. This class overrides Laravel's FreshCommand command. As we are dealing with just one database now, this class is no longer needed.
Also, there was an issue when running php artisan processmaker:install (FOUR-6875) and php artisan migrate:refresh (FOUR-6925)
Solution
Remove the MigrateFresh class and all its references, and make sure the php artisan migrate:refresh command can be used. Also, made some changes in 2 drop methods within the migrations to resolve the artisan migrate bug.
How to Test FOUR-6887 and FOUR-6875
- run php artisan processmaker:install
- run php artisan migrate:refresh
How to Test FOUR-6925
- run php artisan migrate
- run php artisan migrate:refresh
Related Tickets
- FOUR-6925 and FOUR-6875
Code Review Checklist
- [x] I have pulled this code locally and tested it on my instance, along with any associated packages.
- [x] This code adheres to ProcessMaker Coding Guidelines.
- [ ] This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
- [x] This solution fixes the bug reported in the original ticket.
- [x] This solution does not alter the expected output of a component in a way that would break existing Processes.
- [x] This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
- [x] This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
- [x] This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
- [x] This ticket conforms to the PRD associated with this part of ProcessMaker.
.
@estebangallego ,
In order to not bringing back the bug reported in FOUR-6875, would you consider updating the Install command with this code snippet ?
$this->info('Creating migrations table...');
$this->call('migrate:install');
// Install migrations
$this->call('migrate', [
'--seed' => true,
'--force' => true,
]);
@estebangallego Could you check if we still need this fix https://github.com/ProcessMaker/processmaker/pull/4546/files with this PR? To test, you can run phpunit tests/Feature/Api/ChangePasswordTest.php. If we don't need it please remove that line in bootstrap.php as part of this PR. Thanks!
All comments are resolved now, thank you @nolanpro.
@estebangallego ,
In order to not bringing back the bug reported in FOUR-6875, would you consider updating the Install command with this code snippet ?
$this->info('Creating migrations table...'); $this->call('migrate:install'); // Install migrations $this->call('migrate', [ '--seed' => true, '--force' => true, ]);
Thank you @paulosakamoto, this has been resolved as well.