Changeset View
Changeset View
Standalone View
Standalone View
src/database/migrations/2020_10_29_100000_add_beta_skus.php
<?php | <?php | ||||
use Illuminate\Support\Facades\Schema; | use Illuminate\Support\Facades\Schema; | ||||
use Illuminate\Database\Schema\Blueprint; | use Illuminate\Database\Schema\Blueprint; | ||||
use Illuminate\Database\Migrations\Migration; | use Illuminate\Database\Migrations\Migration; | ||||
// phpcs:ignore | // phpcs:ignore | ||||
class AddBetaSkus extends Migration | class AddBetaSkus extends Migration | ||||
{ | { | ||||
/** | /** | ||||
* Run the migrations. | * Run the migrations. | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function up() | public function up() | ||||
{ | { | ||||
if (!\App\Sku::where('title', 'beta')->first()) { | // empty | ||||
\App\Sku::create([ | |||||
'title' => 'beta', | |||||
'name' => 'Beta program', | |||||
'description' => 'Access to beta program subscriptions', | |||||
'cost' => 0, | |||||
'units_free' => 0, | |||||
'period' => 'monthly', | |||||
'handler_class' => 'App\Handlers\Beta', | |||||
'active' => false, | |||||
]); | |||||
} | |||||
if (!\App\Sku::where('title', 'meet')->first()) { | |||||
\App\Sku::create([ | |||||
'title' => 'meet', | |||||
'name' => 'Video chat', | |||||
'description' => 'Video conferencing tool', | |||||
'cost' => 0, | |||||
'units_free' => 0, | |||||
'period' => 'monthly', | |||||
'handler_class' => 'App\Handlers\Beta\Meet', | |||||
'active' => true, | |||||
]); | |||||
} | |||||
} | } | ||||
/** | /** | ||||
* Reverse the migrations. | * Reverse the migrations. | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function down() | public function down() | ||||
{ | { | ||||
// there's no need to remove these SKUs | // there's no need to remove these SKUs | ||||
} | } | ||||
} | } |