1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 07:02:34 +01:00
invoiceninja/database/migrations/2022_11_16_093535_calmness_design.php

48 lines
963 B
PHP
Raw Normal View History

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 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()
{
//
}
};