-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8b0431f
commit 6cc0add
Showing
72 changed files
with
945 additions
and
267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
121 changes: 121 additions & 0 deletions
121
database/migrations-playground/2014_10_12_000000_create_users_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Query\Expression; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::create('users', function (Blueprint $table) { | ||
|
||
// IDs | ||
$table->uuid('id')->primary(); | ||
|
||
$table->uuid('created_id')->nullable()->index(); | ||
$table->uuid('modified_id')->nullable()->index(); | ||
|
||
// Date columns | ||
|
||
$table->timestamps(); | ||
$table->timestamp('email_verified_at')->nullable(); | ||
|
||
// Status | ||
|
||
$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); | ||
|
||
// UI | ||
|
||
$table->string('style', 128)->default(''); | ||
$table->string('klass', 128)->default(''); | ||
$table->string('icon', 128)->default(''); | ||
|
||
// Entity columns | ||
|
||
$table->string('name')->default(''); | ||
$table->string('email')->unique(); | ||
$table->string('password')->default(''); | ||
$table->string('phone')->default(''); | ||
$table->string('locale')->default(''); | ||
$table->string('timezone')->default(''); | ||
|
||
$table->rememberToken(); | ||
|
||
$table->string('role')->default(''); | ||
|
||
// A link to the external source of the user. | ||
$table->string('url', 512)->default(''); | ||
|
||
// Description is an internal field. | ||
$table->string('description', 512)->default(''); | ||
|
||
$table->string('image', 512)->default(''); | ||
$table->string('avatar', 512)->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(''); | ||
|
||
// 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(); | ||
|
||
$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->json('roles') | ||
->default(new Expression('(JSON_ARRAY())')) | ||
->comment('Array of role strings'); | ||
$table->json('permissions') | ||
->default(new Expression('(JSON_ARRAY())')) | ||
->comment('Array of permission strings'); | ||
$table->json('privileges') | ||
->default(new Expression('(JSON_ARRAY())')) | ||
->comment('Array of privilege strings'); | ||
|
||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::dropIfExists('users'); | ||
} | ||
}; |
28 changes: 28 additions & 0 deletions
28
database/migrations-playground/2014_10_12_100000_create_password_reset_tokens_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class() extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::create('password_reset_tokens', function (Blueprint $table) { | ||
$table->string('email')->primary(); | ||
$table->string('token'); | ||
$table->timestamp('created_at')->nullable(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::dropIfExists('password_reset_tokens'); | ||
} | ||
}; |
33 changes: 33 additions & 0 deletions
33
database/migrations-playground/2019_12_14_000001_create_personal_access_tokens_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class() extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::create('personal_access_tokens', function (Blueprint $table) { | ||
$table->id(); | ||
$table->uuidMorphs('tokenable'); | ||
$table->string('name'); | ||
$table->string('token', 64)->unique(); | ||
$table->text('abilities')->nullable(); | ||
$table->timestamp('last_used_at')->nullable(); | ||
$table->timestamp('expires_at')->nullable(); | ||
$table->timestamps(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::dropIfExists('personal_access_tokens'); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.