File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -11,12 +11,18 @@ class AddDescriptionColumnToRedirectsTable extends UpdateScript
1111{
1212 public function shouldUpdate ($ newVersion , $ oldVersion )
1313 {
14- if (config ('statamic.redirect.redirect_connection ' ) === 'stache ' ) {
14+ $ connection = config ('statamic.redirect.redirect_connection ' );
15+
16+ if ($ connection === 'stache ' ) {
1517 return false ;
1618 }
1719
20+ if ($ connection === 'default ' ) {
21+ $ connection = config ('database.default ' );
22+ }
23+
1824 try {
19- return ! Schema::connection (config ( ' statamic.redirect.redirect_connection ' ) )->hasColumn ('redirects ' , 'description ' );
25+ return ! Schema::connection ($ connection )->hasColumn ('redirects ' , 'description ' );
2026 } catch (QueryException ) {
2127 // Query exception happens when database is not set up
2228 return false ;
@@ -29,6 +35,6 @@ public function update()
2935 '--tag ' => 'statamic-redirect-redirect-migrations ' ,
3036 ]);
3137
32- $ this ->console ()->info ('New migration for Redirect description published, make sure to it! ' );
38+ $ this ->console ()->info ('New migration for Redirect description published, make sure to run it! ' );
3339 }
3440}
You can’t perform that action at this time.
0 commit comments