Skip to content

Commit

Permalink
fix migration exists
Browse files Browse the repository at this point in the history
  • Loading branch information
naopusyu committed Mar 17, 2024
1 parent ae2f941 commit 7d4607d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 12 deletions.
11 changes: 8 additions & 3 deletions src/Illuminate/Queue/Console/BatchesTableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,15 @@ protected function migrationExists($table)
return parent::migrationExists($table);
}

return count($this->files->glob(sprintf(
'{%s,%s}',
foreach ([
join_paths($this->laravel->databasePath('migrations'), '*_*_*_*_create_'.$table.'_table.php'),
join_paths($this->laravel->databasePath('migrations'), '0001_01_01_000002_create_jobs_table.php'),
))) !== 0;
] as $path) {
if (count($this->files->glob($path)) !== 0) {
return true;
}
}

return false;
}
}
11 changes: 8 additions & 3 deletions src/Illuminate/Queue/Console/FailedTableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,15 @@ protected function migrationExists($table)
return parent::migrationExists($table);
}

return count($this->files->glob(sprintf(
'{%s,%s}',
foreach ([
join_paths($this->laravel->databasePath('migrations'), '*_*_*_*_create_'.$table.'_table.php'),
join_paths($this->laravel->databasePath('migrations'), '0001_01_01_000002_create_jobs_table.php'),
))) !== 0;
] as $path) {
if (count($this->files->glob($path)) !== 0) {
return true;
}
}

return false;
}
}
11 changes: 8 additions & 3 deletions src/Illuminate/Queue/Console/TableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,15 @@ protected function migrationExists($table)
return parent::migrationExists($table);
}

return count($this->files->glob(sprintf(
'{%s,%s}',
foreach ([
join_paths($this->laravel->databasePath('migrations'), '*_*_*_*_create_'.$table.'_table.php'),
join_paths($this->laravel->databasePath('migrations'), '0001_01_01_000002_create_jobs_table.php'),
))) !== 0;
] as $path) {
if (count($this->files->glob($path)) !== 0) {
return true;
}
}

return false;
}
}
11 changes: 8 additions & 3 deletions src/Illuminate/Session/Console/SessionTableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,15 @@ protected function migrationStubFile()
*/
protected function migrationExists($table)
{
return count($this->files->glob(sprintf(
'{%s,%s}',
foreach ([
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;
] as $path) {
if (count($this->files->glob($path)) !== 0) {
return true;
}
}

return false;
}
}

0 comments on commit 7d4607d

Please sign in to comment.