-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from chkilel/dev
Plugin Version 2
- Loading branch information
Showing
7 changed files
with
80 additions
and
12 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
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,36 @@ | ||
<?php | ||
|
||
namespace Chkilel\Icones\Updates; | ||
|
||
use Schema; | ||
use Illuminate\Support\Facades\DB; | ||
use October\Rain\Database\Schema\Blueprint; | ||
use October\Rain\Database\Updates\Migration; | ||
|
||
class UpgradeIconSetsTable extends Migration | ||
{ | ||
public function up() | ||
{ | ||
//move the value to the new datatype | ||
//Colourful => 1, Colorless => 0 | ||
DB::table('chkilel_icones_icon_sets')->where('palette', 'Colorless')->update(['palette' => false]); | ||
DB::table('chkilel_icones_icon_sets')->where('palette', 'Colorful')->update(['palette' => true]); | ||
|
||
// Change the datatype of the column | ||
Schema::table('chkilel_icones_icon_sets', function (Blueprint $table) { | ||
$table->boolean('palette')->change(); | ||
}); | ||
|
||
} | ||
|
||
public function down() | ||
{ | ||
Schema::table('chkilel_icones_icon_sets', function (Blueprint $table) { | ||
$table->string('palette')->change(); | ||
}); | ||
//Roll back the value to the old datatype | ||
// 1 => Colourful , 0 => Colorless | ||
DB::table('chkilel_icones_icon_sets')->where('palette', '0')->update(['palette' => 'Colorless']); | ||
DB::table('chkilel_icones_icon_sets')->where('palette', '1')->update(['palette' => 'Colorful']); | ||
} | ||
} |
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