mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
MultiDB design updating
This commit is contained in:
parent
67b97cd751
commit
db1878ee97
34
database/migrations/2021_05_27_105157_add_tech_design.php
Normal file
34
database/migrations/2021_05_27_105157_add_tech_design.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Design;
|
||||
use App\Utils\Ninja;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddTechDesign extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if (Ninja::isHosted()) {
|
||||
return Design::create(['id' => 10, 'name' => 'Tech', 'user_id' => null, 'company_id' => null, 'is_custom' => false, 'design' => '', 'is_active' => true]);
|
||||
}
|
||||
|
||||
if (Design::count() !== 0) {
|
||||
return Design::create(['name' => 'Tech', 'user_id' => null, 'company_id' => null, 'is_custom' => false, 'design' => '', 'is_active' => true]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
@ -36,6 +36,7 @@ class DesignSeeder extends Seeder
|
||||
['id' => 7, 'name' => 'Elegant', 'user_id' => null, 'company_id' => null, 'is_custom' => false, 'design' => '', 'is_active' => true],
|
||||
['id' => 8, 'name' => 'Hipster', 'user_id' => null, 'company_id' => null, 'is_custom' => false, 'design' => '', 'is_active' => true],
|
||||
['id' => 9, 'name' => 'Playful', 'user_id' => null, 'company_id' => null, 'is_custom' => false, 'design' => '', 'is_active' => true],
|
||||
['id' => 10, 'name' => 'Tech', 'user_id' => null, 'company_id' => null, 'is_custom' => false, 'design' => '', 'is_active' => true],
|
||||
];
|
||||
|
||||
foreach ($designs as $design) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user