Skip to content

Commit 9fc1c39

Browse files
committed
Only publish global variables origin migration when table exists
1 parent 4a77ff4 commit 9fc1c39

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Updates/DropOriginOnGlobalSetVariables.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
namespace Statamic\Eloquent\Updates;
44

5+
use Illuminate\Support\Facades\Schema;
56
use Statamic\UpdateScripts\UpdateScript;
67

78
class DropOriginOnGlobalSetVariables extends UpdateScript
89
{
910
public function shouldUpdate($newVersion, $oldVersion)
1011
{
11-
return $this->isUpdatingTo('5.0.0');
12+
$globalSetVariablesTable = config('statamic.eloquent-driver.table_prefix', '').'global_set_variables';
13+
14+
return $this->isUpdatingTo('5.0.0')
15+
&& Schema::hasTable($globalSetVariablesTable) && Schema::hasColumn($globalSetVariablesTable, 'origin');
1216
}
1317

1418
public function update()

0 commit comments

Comments
 (0)