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 970b70e commit a2f887b
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 122 deletions.
4 changes: 2 additions & 2 deletions database/factories/NoteFactory.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
55 changes: 17 additions & 38 deletions database/migrations/2020_01_02_100001_create_matrix_notes_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\Note
*/
return new class() extends Migration
{
/**
Expand All @@ -18,6 +21,7 @@
public function up(): void
{
Schema::create('matrix_notes', function (Blueprint $table) {

// Primary key

$table->uuid('id')->primary();
Expand All @@ -30,28 +34,14 @@ public function up(): void
$table->uuid('parent_id')->nullable()->index();
$table->string('note_type')->nullable()->index();
$table->uuid('matrix_id')->nullable()->index();
$table->uuid('tag_id')->nullable()->index();

// Dates

$table->timestamps();

$table->softDeletes();

$table->dateTime('start_at')->nullable()->index();
$table->dateTime('planned_start_at')->nullable();
$table->dateTime('end_at')->nullable()->index();
$table->dateTime('planned_end_at')->nullable();
$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

$table->bigInteger('gids')->default(0)->unsigned();
Expand All @@ -75,48 +65,41 @@ 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('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('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 All @@ -126,13 +109,9 @@ public function up(): void
// JSON

$table->json('assets')->nullable()->default(new Expression('(JSON_OBJECT())'));
$table->json('backlog')->nullable()->default(new Expression('(JSON_OBJECT())'));
$table->json('board')->nullable()->default(new Expression('(JSON_OBJECT())'));
$table->json('flow')->nullable()->default(new Expression('(JSON_OBJECT())'));
$table->json('meta')->nullable()->default(new Expression('(JSON_OBJECT())'));
$table->json('notes')->nullable()->default(new Expression('(JSON_ARRAY())'))->comment('Array of note objects');
$table->json('options')->nullable()->default(new Expression('(JSON_OBJECT())'));
$table->json('roadmap')->nullable()->default(new Expression('(JSON_OBJECT())'));
$table->json('sources')->nullable()->default(new Expression('(JSON_OBJECT())'));
});
}
Expand Down
Loading

0 comments on commit a2f887b

Please sign in to comment.