2022-11-16 10:57:08 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use App\Models\Design;
|
2022-11-16 13:08:03 +01:00
|
|
|
use App\Utils\Ninja;
|
2022-11-16 10:57:08 +01:00
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
2023-02-16 02:36:09 +01:00
|
|
|
return new class extends Migration {
|
2022-11-16 10:57:08 +01:00
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
2022-11-16 13:08:03 +01:00
|
|
|
if (Ninja::isHosted()) {
|
|
|
|
$design = new Design();
|
2022-11-16 10:57:08 +01:00
|
|
|
|
2022-11-16 13:08:03 +01:00
|
|
|
$design->name = 'Calm';
|
|
|
|
$design->is_custom = false;
|
|
|
|
$design->design = '';
|
|
|
|
$design->is_active = true;
|
2022-11-16 11:07:55 +01:00
|
|
|
|
2022-11-16 13:08:03 +01:00
|
|
|
$design->save();
|
|
|
|
} elseif (Design::count() !== 0) {
|
|
|
|
$design = new Design();
|
2022-11-16 10:57:08 +01:00
|
|
|
|
2022-11-16 13:08:03 +01:00
|
|
|
$design->name = 'Calm';
|
|
|
|
$design->is_custom = false;
|
|
|
|
$design->design = '';
|
|
|
|
$design->is_active = true;
|
2022-11-16 10:57:08 +01:00
|
|
|
|
2022-11-16 13:08:03 +01:00
|
|
|
$design->save();
|
|
|
|
}
|
2022-11-16 10:57:08 +01:00
|
|
|
|
2022-11-16 13:08:03 +01:00
|
|
|
\Illuminate\Support\Facades\Artisan::call('ninja:design-update');
|
2022-11-16 10:57:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
//
|
|
|
|
}
|
|
|
|
};
|