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

[11.x] Fixed make:session-table Artisan command cannot be executed if a migration exists #50615

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

naopusyu
Copy link
Contributor

The original code did not check the existence properly.

    protected function migrationExists($table)
    {
        return count($this->files->glob(sprintf(
            '{%s,%s}',
            join_paths($this->laravel->databasePath('migrations'), '*_*_*_*_create_'.$table.'_table.php'),
            join_paths($this->laravel->databasePath('migrations'), '0001_01_01_000000_create_users_table.php'),
        ))) !== 0;
    }

Changed to check the existence of targets in order

A similar issue also occurred with the following Artisan commands and has been fixed.

  • make:queue-batches-table
  • make:queue-failed-table
  • make:queue-table

@driesvints driesvints changed the title [11.x] Fixed make:session-table Artisan command cannot be executed if a migration exists. [11.x] Fixed make:session-table Artisan command cannot be executed if a migration exists Mar 18, 2024
@nunomaduro nunomaduro marked this pull request as draft March 18, 2024 15:27
@crynobone crynobone marked this pull request as ready for review March 19, 2024 09:48
@taylorotwell taylorotwell merged commit 7894b0b into laravel:11.x Mar 19, 2024
30 checks passed
@naopusyu naopusyu deleted the fix-migration-exists branch March 21, 2024 14:22
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.

None yet

3 participants