-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix validation for eloquent redirects * Revert "Fix validation for eloquent redirects" This reverts commit dbff7f0. * Fix error on site creation * Use site column in `findByUrl` query
- Loading branch information
Showing
4 changed files
with
33 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Rias\StatamicRedirect\UpdateScripts; | ||
|
||
use Illuminate\Support\Facades\Schema; | ||
use Statamic\UpdateScripts\UpdateScript; | ||
|
||
class RenameLocaleToSiteOnRedirectsTable extends UpdateScript | ||
{ | ||
public function shouldUpdate($newVersion, $oldVersion) | ||
{ | ||
return Schema::hasColumn('redirects', 'locale'); | ||
} | ||
|
||
public function update() | ||
{ | ||
Schema::table('redirects', function ($table) { | ||
$table->renameColumn('locale', 'site'); | ||
$table->index(['site']); | ||
}); | ||
|
||
$this->console()->info('Column renamed succesfully!'); | ||
} | ||
} |