Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gammamatrix committed Apr 27, 2024
1 parent a8cffa3 commit 764fadc
Show file tree
Hide file tree
Showing 14 changed files with 391 additions and 55 deletions.
4 changes: 2 additions & 2 deletions database/factories/BoardFactory.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

declare(strict_types=1);
/**
* Playground
*/

declare(strict_types=1);
namespace Database\Factories\Playground\Matrix\Models;

use Illuminate\Database\Eloquent\Factories\Factory;
Expand Down
4 changes: 2 additions & 2 deletions database/factories/SprintFactory.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

declare(strict_types=1);
/**
* Playground
*/

declare(strict_types=1);
namespace Database\Factories\Playground\Matrix\Models;

use Illuminate\Database\Eloquent\Factories\Factory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Illuminate\Support\Facades\Schema;

/**
* Backlog
* \Playground\Matrix\Models\Backlog
*/
return new class() extends Migration
{
Expand Down Expand Up @@ -93,13 +93,13 @@ public function up(): void
$table->bigInteger('x')->nullable();
$table->bigInteger('y')->nullable();
$table->bigInteger('z')->nullable();
$table->decimal('r', 65, 10)->nullable()->default(null);
$table->decimal('theta', 10, 6)->nullable()->default(null);
$table->decimal('rho', 10, 6)->nullable()->default(null);
$table->decimal('phi', 10, 6)->nullable()->default(null);
$table->decimal('elevation', 65, 10)->nullable()->default(null);
$table->decimal('latitude', 8, 6)->nullable()->default(null);
$table->decimal('longitude', 9, 6)->nullable()->default(null);
$table->decimal('r', 65, 10)->nullable();
$table->decimal('theta', 10, 6)->nullable();
$table->decimal('rho', 10, 6)->nullable();
$table->decimal('phi', 10, 6)->nullable();
$table->decimal('elevation', 65, 10)->nullable();
$table->decimal('latitude', 8, 6)->nullable();
$table->decimal('longitude', 9, 6)->nullable();

// Flags

Expand Down Expand Up @@ -130,7 +130,7 @@ public function up(): void
$table->string('label')->default('');
$table->string('title')->default('');
$table->string('byline')->default('');
$table->string('slug')->nullable()->default(null)->index();
$table->string('slug')->nullable()->index();
$table->string('url')->default('');
$table->string('description')->default('');
$table->string('introduction')->default('');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<?php

declare(strict_types=1);
/**
* Playground
*/

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Query\Expression;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

/**
* \Playground\Matrix\Models\Board
*/
return new class() extends Migration
{
/**
Expand All @@ -18,6 +21,7 @@
public function up(): void
{
Schema::create('matrix_boards', function (Blueprint $table) {

// Primary key

$table->uuid('id')->primary();
Expand All @@ -28,8 +32,8 @@ public function up(): void
$table->uuid('modified_by_id')->nullable()->index();
$table->uuid('owned_by_id')->nullable()->index();
$table->uuid('parent_id')->nullable()->index();
$table->string('board_type')->nullable()->index();
$table->uuid('backlog_id')->nullable()->index();
$table->string('board_type')->nullable()->index();
$table->uuid('epic_id')->nullable()->index();
$table->uuid('flow_id')->nullable()->index();
$table->uuid('matrix_id')->nullable()->index();
Expand Down Expand Up @@ -89,20 +93,21 @@ public function up(): void
$table->bigInteger('x')->nullable();
$table->bigInteger('y')->nullable();
$table->bigInteger('z')->nullable();
$table->decimal('r', 65, 10)->nullable()->default(null);
$table->decimal('theta', 10, 6)->nullable()->default(null);
$table->decimal('rho', 10, 6)->nullable()->default(null);
$table->decimal('phi', 10, 6)->nullable()->default(null);
$table->decimal('elevation', 65, 10)->nullable()->default(null);
$table->decimal('latitude', 8, 6)->nullable()->default(null);
$table->decimal('longitude', 9, 6)->nullable()->default(null);
$table->decimal('r', 65, 10)->nullable();
$table->decimal('theta', 10, 6)->nullable();
$table->decimal('rho', 10, 6)->nullable();
$table->decimal('phi', 10, 6)->nullable();
$table->decimal('elevation', 65, 10)->nullable();
$table->decimal('latitude', 8, 6)->nullable();
$table->decimal('longitude', 9, 6)->nullable();

// Flags

$table->boolean('active')->default(1)->index();
$table->boolean('canceled')->default(0);
$table->boolean('closed')->default(0);
$table->boolean('completed')->default(0);
$table->boolean('cron')->default(0)->index();
$table->boolean('duplicate')->default(0);
$table->boolean('fixed')->default(0);
$table->boolean('flagged')->default(0);
Expand All @@ -118,19 +123,19 @@ public function up(): void
$table->boolean('suspended')->default(0);
$table->boolean('unknown')->default(0);

// Strings
// Columns

$table->string('label')->default('');
$table->string('title')->default('');
$table->string('byline')->default('');
$table->string('slug')->nullable()->default(null)->index();
$table->string('slug')->nullable()->index();
$table->string('url')->default('');
$table->string('description')->default('');
$table->string('introduction')->default('');
$table->mediumText('content')->nullable();
$table->mediumText('summary')->nullable();

// UI
// Ui

$table->string('icon')->default('');
$table->string('image')->default('');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<?php

declare(strict_types=1);
/**
* Playground
*/

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Query\Expression;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

/**
* \Playground\Matrix\Models\Sprint
*/
return new class() extends Migration
{
/**
Expand All @@ -18,6 +21,7 @@
public function up(): void
{
Schema::create('matrix_sprints', function (Blueprint $table) {

// Primary key

$table->uuid('id')->primary();
Expand Down Expand Up @@ -89,20 +93,21 @@ public function up(): void
$table->bigInteger('x')->nullable();
$table->bigInteger('y')->nullable();
$table->bigInteger('z')->nullable();
$table->decimal('r', 65, 10)->nullable()->default(null);
$table->decimal('theta', 10, 6)->nullable()->default(null);
$table->decimal('rho', 10, 6)->nullable()->default(null);
$table->decimal('phi', 10, 6)->nullable()->default(null);
$table->decimal('elevation', 65, 10)->nullable()->default(null);
$table->decimal('latitude', 8, 6)->nullable()->default(null);
$table->decimal('longitude', 9, 6)->nullable()->default(null);
$table->decimal('r', 65, 10)->nullable();
$table->decimal('theta', 10, 6)->nullable();
$table->decimal('rho', 10, 6)->nullable();
$table->decimal('phi', 10, 6)->nullable();
$table->decimal('elevation', 65, 10)->nullable();
$table->decimal('latitude', 8, 6)->nullable();
$table->decimal('longitude', 9, 6)->nullable();

// Flags

$table->boolean('active')->default(1)->index();
$table->boolean('canceled')->default(0);
$table->boolean('closed')->default(0);
$table->boolean('completed')->default(0);
$table->boolean('cron')->default(0)->index();
$table->boolean('duplicate')->default(0);
$table->boolean('fixed')->default(0);
$table->boolean('flagged')->default(0);
Expand All @@ -118,19 +123,19 @@ public function up(): void
$table->boolean('suspended')->default(0);
$table->boolean('unknown')->default(0);

// Strings
// Columns

$table->string('label')->default('');
$table->string('title')->default('');
$table->string('byline')->default('');
$table->string('slug')->nullable()->default(null)->index();
$table->string('slug')->nullable()->index();
$table->string('url')->default('');
$table->string('description')->default('');
$table->string('introduction')->default('');
$table->mediumText('content')->nullable();
$table->mediumText('summary')->nullable();

// UI
// Ui

$table->string('icon')->default('');
$table->string('image')->default('');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Illuminate\Support\Facades\Schema;

/**
* Playground\Matrix\Models\Ticket
* \Playground\Matrix\Models\Ticket
*/
return new class() extends Migration
{
Expand Down Expand Up @@ -112,6 +112,7 @@ public function up(): void
$table->boolean('canceled')->default(0);
$table->boolean('closed')->default(0);
$table->boolean('completed')->default(0);
$table->boolean('cron')->default(0)->index();
$table->boolean('duplicate')->default(0);
$table->boolean('fixed')->default(0);
$table->boolean('flagged')->default(0);
Expand All @@ -128,7 +129,6 @@ public function up(): void
$table->boolean('special')->default(0);
$table->boolean('suspended')->default(0);
$table->boolean('unknown')->default(0);
$table->boolean('cron')->default(0)->index();

// Columns

Expand Down
49 changes: 47 additions & 2 deletions src/Models/Backlog.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,17 @@ class Backlog extends Model
'status' => 0,
'rank' => 0,
'size' => 0,
'matrix' => '{}',
'x' => null,
'y' => null,
'z' => null,
'r' => null,
'theta' => null,
'rho' => null,
'phi' => null,
'elevation' => null,
'latitude' => null,
'longitude' => null,
'active' => true,
'canceled' => false,
'closed' => false,
Expand Down Expand Up @@ -267,6 +278,17 @@ class Backlog extends Model
'status',
'rank',
'size',
'matrix',
'x',
'y',
'z',
'r',
'theta',
'rho',
'phi',
'elevation',
'latitude',
'longitude',
'active',
'canceled',
'closed',
Expand Down Expand Up @@ -344,6 +366,17 @@ protected function casts(): array
'only_guest' => 'boolean',
'allow_public' => 'boolean',
'status' => 'integer',
'matrix' => 'array',
'x' => 'integer',
'y' => 'integer',
'z' => 'integer',
'r' => 'float',
'theta' => 'float',
'rho' => 'float',
'phi' => 'float',
'elevation' => 'float',
'latitude' => 'float',
'longitude' => 'float',
'rank' => 'integer',
'size' => 'integer',
'active' => 'boolean',
Expand Down Expand Up @@ -426,6 +459,18 @@ public function flow(): HasOne
);
}

/**
* The matrix of the backlog.
*/
public function matrix(): HasOne
{
return $this->hasOne(
Matrix::class,
'id',
'matrix_id'
);
}

/**
* The milestone of the backlog.
*/
Expand Down Expand Up @@ -565,7 +610,7 @@ public function sprints(): HasMany
{
return $this->hasMany(
Sprint::class,
'sprint_id',
'backlog_id',
'id'
);
}
Expand All @@ -577,7 +622,7 @@ public function tickets(): HasMany
{
return $this->hasMany(
Ticket::class,
'ticket_id',
'backlog_id',
'id'
);
}
Expand Down
Loading

0 comments on commit 764fadc

Please sign in to comment.