Skip to content

Commit 959aa11

Browse files
Show warning banner when database isn't configured (#56)
1 parent 57543f6 commit 959aa11

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

resources/js/components/EditImportForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</div>
1212
</div>
1313

14-
<div v-if="batchesTableMissing" class="text-xs border border-yellow-dark rounded p-4 bg-yellow dark:bg-dark-blue-100 dark:border-none">
14+
<div v-if="batchesTableMissing" class="text-xs border border-yellow-dark rounded p-4 bg-yellow dark:bg-dark-blue-100 dark:border-none mb-6">
1515
<div class="font-bold mb-2">{{ __('Please run your migrations.') }}</div>
1616
<p v-html="__('importer::messages.migrations_needed')"></p>
1717
</div>

src/Http/Controllers/ImportController.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Statamic\Importer\Http\Controllers;
44

5+
use Illuminate\Database\QueryException;
56
use Illuminate\Http\Request;
67
use Illuminate\Support\Arr;
78
use Illuminate\Support\Facades\Artisan;
@@ -215,8 +216,12 @@ private function createBlueprint(): Blueprint
215216

216217
private function ensureJobBatchesTableExists(): bool
217218
{
218-
if (Schema::connection(config('queue.batching.database'))->hasTable(config('queue.batching.table'))) {
219-
return true;
219+
try {
220+
if (Schema::connection(config('queue.batching.database'))->hasTable(config('queue.batching.table'))) {
221+
return true;
222+
}
223+
} catch (QueryException $e) {
224+
return false;
220225
}
221226

222227
if (app()->runningUnitTests() || app()->isProduction()) {

0 commit comments

Comments
 (0)