Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gammamatrix committed Apr 28, 2024
1 parent ee1574f commit d3caf9c
Show file tree
Hide file tree
Showing 13 changed files with 316 additions and 138 deletions.
4 changes: 2 additions & 2 deletions database/factories/MatrixFactory.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/ProjectFactory.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/TeamFactory.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
@@ -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\Matrix
*/
return new class() extends Migration
{
/**
Expand All @@ -18,6 +21,7 @@
public function up(): void
{
Schema::create('matrix_matrices', function (Blueprint $table) {

// Primary key

$table->uuid('id')->primary();
Expand All @@ -27,9 +31,9 @@ public function up(): void
$table->uuid('created_by_id')->nullable()->index();
$table->uuid('modified_by_id')->nullable()->index();
$table->uuid('owned_by_id')->nullable()->index();
$table->uuid('matrix_id')->nullable()->index();
$table->uuid('parent_id')->nullable()->index();
$table->string('matrix_type')->nullable()->index();
$table->uuid('matrix_id')->nullable()->index();

// Dates

Expand All @@ -43,6 +47,8 @@ public function up(): void
$table->dateTime('planned_end_at')->nullable();
$table->dateTime('canceled_at')->nullable();
$table->dateTime('closed_at')->nullable()->index();
$table->dateTime('embargo_at')->nullable();
$table->dateTime('postponed_at')->nullable();
$table->dateTime('resumed_at')->nullable();
$table->dateTime('suspended_at')->nullable();

Expand All @@ -69,19 +75,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('flagged')->default(0);
$table->boolean('internal')->default(0);
$table->boolean('locked')->default(0);
Expand All @@ -92,23 +100,23 @@ 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('url')->default('');
$table->string('description')->default('');
$table->string('introduction')->default('');
$table->string('label', 128)->default('');
$table->string('title', 255)->default('');
$table->string('byline', 255)->default('');
$table->string('slug', 128)->nullable()->index();
$table->string('url', 512)->default('');
$table->string('description', 512)->default('');
$table->string('introduction', 512)->default('');
$table->mediumText('content')->nullable();
$table->mediumText('summary')->nullable();

// UI
// Ui

$table->string('icon')->default('');
$table->string('image')->default('');
$table->string('avatar')->default('');
$table->string('icon', 128)->default('');
$table->string('image', 512)->default('');
$table->string('avatar', 512)->default('');
$table->json('ui')->nullable()->default(new Expression('(JSON_OBJECT())'));

// JSON
Expand Down
56 changes: 26 additions & 30 deletions database/migrations/2020_01_02_100001_create_matrix_teams_table.php
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\Team
*/
return new class() extends Migration
{
/**
Expand All @@ -18,6 +21,7 @@
public function up(): void
{
Schema::create('matrix_teams', function (Blueprint $table) {

// Primary key

$table->uuid('id')->primary();
Expand Down Expand Up @@ -58,12 +62,8 @@ public function up(): void
$table->dateTime('canceled_at')->nullable();
$table->dateTime('closed_at')->nullable()->index();
$table->dateTime('embargo_at')->nullable();
$table->dateTime('fixed_at')->nullable();
$table->dateTime('postponed_at')->nullable();
$table->dateTime('published_at')->nullable();
$table->dateTime('released_at')->nullable();
$table->dateTime('resumed_at')->nullable();
$table->dateTime('resolved_at')->nullable()->index();
$table->dateTime('suspended_at')->nullable();

// Permissions
Expand All @@ -89,52 +89,48 @@ 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('duplicate')->default(0);
$table->boolean('fixed')->default(0);
$table->boolean('cron')->default(0)->index();
$table->boolean('flagged')->default(0);
$table->boolean('internal')->default(0);
$table->boolean('locked')->default(0);
$table->boolean('pending')->default(0);
$table->boolean('planned')->default(0);
$table->boolean('problem')->default(0);
$table->boolean('published')->default(0);
$table->boolean('released')->default(0);
$table->boolean('retired')->default(0);
$table->boolean('resolved')->default(0);
$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('url')->default('');
$table->string('description')->default('');
$table->string('introduction')->default('');
$table->string('label', 128)->default('');
$table->string('title', 255)->default('');
$table->string('byline', 255)->default('');
$table->string('slug', 128)->nullable()->index();
$table->string('url', 512)->default('');
$table->string('description', 512)->default('');
$table->string('introduction', 512)->default('');
$table->mediumText('content')->nullable();
$table->mediumText('summary')->nullable();

// UI
// Ui

$table->string('icon')->default('');
$table->string('image')->default('');
$table->string('avatar')->default('');
$table->string('icon', 128)->default('');
$table->string('image', 512)->default('');
$table->string('avatar', 512)->default('');
$table->json('ui')->nullable()->default(new Expression('(JSON_OBJECT())'));

// JSON
Expand Down
Loading

0 comments on commit d3caf9c

Please sign in to comment.