Handle empty dbSchema table (#15198)

For example during install.  Seeder is run after migrations.
This commit is contained in:
Tony Murray
2023-08-04 08:31:00 -05:00
committed by GitHub
parent 5b409a3700
commit 034ca2d418

View File

@@ -14,8 +14,8 @@ return new class extends Migration
*/
public function up(): void
{
if (Schema::hasTable('dbSchema')) {
if (DB::table('dbSchema')->first()->version != 1000) {
if (Schema::hasTable('dbSchema') && DB::table('dbSchema')->exists()) {
if (DB::table('dbSchema')->value('version') != 1000) {
$error = 'Unsupported upgrade path! You need to update to version 23.7.0 first!';
Log::error($error);
exit($error);