-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'statamic-5' into fix/add-arguments-to-import-commands
- Loading branch information
Showing
9 changed files
with
64 additions
and
22 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
21 changes: 21 additions & 0 deletions
21
database/migrations/updates/drop_status_on_entries.php.stub
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,21 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
use Statamic\Eloquent\Database\BaseMigration as Migration; | ||
|
||
return new class extends Migration { | ||
public function up() | ||
{ | ||
Schema::table($this->prefix('entries'), function (Blueprint $table) { | ||
$table->dropColumn('status'); | ||
}); | ||
} | ||
|
||
public function down() | ||
{ | ||
Schema::table($this->prefix('entries'), function (Blueprint $table) { | ||
$table->string('status')->nullable(); | ||
}); | ||
} | ||
}; |
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
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 Statamic\Eloquent\Updates; | ||
|
||
use Statamic\UpdateScripts\UpdateScript; | ||
|
||
class DropStatusOnEntries extends UpdateScript | ||
{ | ||
public function shouldUpdate($newVersion, $oldVersion) | ||
{ | ||
return $this->isUpdatingTo('4.0.0'); | ||
} | ||
|
||
public function update() | ||
{ | ||
$source = __DIR__.'/../../database/migrations/updates/drop_status_on_entries.php.stub'; | ||
$dest = database_path('migrations/'.date('Y_m_d_His').'_drop_status_on_entries.php'); | ||
|
||
$this->files->copy($source, $dest); | ||
|
||
$this->console()->info('Migrations created'); | ||
$this->console()->comment('Remember to run `php artisan migrate` to apply it to your database.'); | ||
} | ||
} |
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