Files
project/database/migrations/2025_02_04_064726_create_dashboards_table.php
2025-02-06 11:08:30 +01:00

77 lines
2.0 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('dashboards', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->integer('width');
$table->integer('height');
$table->integer('sort');
$table->boolean('active');
$table->json('settings')->nullable();
});
DB::table('dashboards')->insert([
'name' => 'dashboard_not_paid',
'width' => 2,
'height' => 1,
'sort' => 0,
'active' => true,
]);
DB::table('dashboards')->insert([
'name' => 'dashboard_not_sent',
'width' => 1,
'height' => 2,
'sort' => 1,
'active' => true,
]);
DB::table('dashboards')->insert([
'name' => 'dashboard_no_address',
'width' => 1,
'height' => 1,
'sort' => 2,
'active' => true,
]);
DB::table('dashboards')->insert([
'name' => 'dashboard_incoming',
'width' => 1,
'height' => 1,
'sort' => 3,
'active' => true,
]);
DB::table('dashboards')->insert([
'name' => 'dashboard_graph_year',
'width' => 2,
'height' => 1,
'sort' => 4,
'active' => true,
]);
DB::table('dashboards')->insert([
'name' => 'dashboard_graph_month',
'width' => 4,
'height' => 1,
'sort' => 5,
'active' => true,
]);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('dashboards');
}
};