Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gammamatrix committed Mar 3, 2024
1 parent 589e9b2 commit a3e0f8d
Show file tree
Hide file tree
Showing 4 changed files with 188 additions and 76 deletions.
1 change: 0 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@
->in([
__DIR__.'/config',
__DIR__.'/database',
__DIR__.'/lang',
__DIR__.'/src',
__DIR__.'/tests/Feature',
__DIR__.'/tests/Unit',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,90 +14,109 @@ public function up(): void
{
Schema::create('users', function (Blueprint $table) {

// IDs
// Primary key

$table->uuid('id')->primary();

$table->uuid('created_id')->nullable()->index();
$table->uuid('modified_id')->nullable()->index();
// IDs

$table->uuid('created_by_id')->nullable()->index();
$table->uuid('modified_by_id')->nullable()->index();
$table->string('user_type')->nullable()->index();

// Date columns

$table->timestamps();

$table->timestamp('email_verified_at')->nullable();
// $table->dateTime('email_verified_at')->nullable();

// Status
$table->dateTime('banned_at')->nullable();
$table->dateTime('suspended_at')->nullable();

$table->softDeletes();

$table->tinyInteger('active')->unsigned()->index()->default(0);
$table->tinyInteger('banned')->unsigned()->index()->default(0);
$table->tinyInteger('closed')->unsigned()->index()->default(0);
$table->tinyInteger('flagged')->unsigned()->index()->default(0);
$table->tinyInteger('internal')->unsigned()->index()->default(0);
$table->tinyInteger('locked')->unsigned()->index()->default(0);
// Permissions

// UI
$table->bigInteger('gids')->default(0)->unsigned();
$table->bigInteger('po')->default(0)->unsigned();
$table->bigInteger('pg')->default(0)->unsigned();
$table->bigInteger('pw')->default(0)->unsigned();

$table->rememberToken();

$table->string('style', 128)->default('');
$table->string('klass', 128)->default('');
$table->string('icon', 128)->default('');
$table->string('role')->default('');

// Status

// Entity columns
$table->bigInteger('status')->default(0)->unsigned();
$table->bigInteger('rank')->default(0);
$table->bigInteger('size')->default(0);

// Flags

$table->boolean('active')->default(1)->index();
$table->boolean('banned')->default(0)->index();
$table->boolean('flagged')->default(0)->index();
$table->boolean('internal')->default(0)->index();
$table->boolean('locked')->default(0)->index();
$table->boolean('problem')->default(0)->index();
$table->boolean('suspended')->default(0)->index();
$table->boolean('unknown')->default(0)->index();

// Strings

$table->string('name')->default('');
$table->string('email')->unique();
$table->string('password')->default('');
$table->string('phone')->default('');
$table->string('phone')->nullable();
$table->string('locale')->default('');
$table->string('timezone')->default('');

$table->rememberToken();

$table->string('role')->default('');
$table->string('label')->default('');
$table->string('title')->default('');
$table->string('byline')->default('');
$table->string('slug')->nullable()->default(null)->index();

// A link to the external source of the user.
$table->string('url', 512)->default('');
$table->string('url')->default('');

// Description is an internal field.
$table->string('description', 512)->default('');

$table->string('image', 512)->default('');
$table->string('avatar', 512)->default('');
$table->string('description')->default('');

// The introduction should be the first 255 characters or less of the content.
// The introduction is visible to the client. No HTML.
$table->string('introduction', 512)->default('');
$table->string('introduction')->default('');

// The HTML content of the user.
$table->mediumText('content')->nullable();

// The summary of the content, HTML allowed, to be shown to the client.
$table->mediumText('summary')->nullable();

// UI

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

$table->json('abilities')
->default(new Expression('(JSON_ARRAY())'))
->comment('Array of ability strings');
$table->json('accounts')
->default(new Expression('(JSON_OBJECT())'))
->comment('User accounts object');
$table->json('address')
->default(new Expression('(JSON_OBJECT())'))
->comment('User address object');
$table->json('contact')
->default(new Expression('(JSON_OBJECT())'))
->comment('User contact object');
$table->json('meta')
->default(new Expression('(JSON_OBJECT())'))
->comment('Model meta object');
$table->json('notes')
->default(new Expression('(JSON_ARRAY())'))
->comment('Array of note objects');
$table->json('options')
->default(new Expression('(JSON_OBJECT())'))
->comment('Model options object');
$table->json('registration')
->default(new Expression('(JSON_OBJECT())'))
->comment('Registration information object');
$table->longText('accounts')
->comment('Encrypted user account objects');
$table->longText('address')
->comment('Encrypted user address object');
$table->longText('contact')
->comment('Encrypted contact object');
$table->longText('meta')
->comment('Encrypted meta object');
$table->longText('notes')
->comment('Encrypted array of note objects');
$table->longText('options')
->comment('Encrypted options object');
$table->longText('registration')
->comment('Encrypted registration information object');
$table->json('roles')
->default(new Expression('(JSON_ARRAY())'))
->comment('Array of role strings');
Expand All @@ -107,6 +126,8 @@ public function up(): void
$table->json('privileges')
->default(new Expression('(JSON_ARRAY())'))
->comment('Array of privilege strings');
$table->longText('sources')
->comment('Encrypted array of sources');

});
}
Expand Down
Loading

0 comments on commit a3e0f8d

Please sign in to comment.