-
Notifications
You must be signed in to change notification settings - Fork 4
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
a829d4d
commit 604c1a0
Showing
6 changed files
with
207 additions
and
69 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
74 changes: 33 additions & 41 deletions
74
database/migrations/2018_08_08_100000_create_telescope_entries_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 |
---|---|---|
@@ -1,70 +1,62 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Get the migration connection name. | ||
*/ | ||
return new class() extends Migration { | ||
public function getConnection(): string|null | ||
{ | ||
return config('telescope.storage.database.connection'); | ||
return config("telescope.storage.database.connection"); | ||
} | ||
|
||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
$schema = Schema::connection($this->getConnection()); | ||
|
||
$schema->create('telescope_entries', function (Blueprint $table) { | ||
$table->bigIncrements('sequence'); | ||
$table->uuid('uuid'); | ||
$table->uuid('batch_id'); | ||
$table->string('family_hash')->nullable(); | ||
$table->boolean('should_display_on_index')->default(true); | ||
$table->string('type', 20); | ||
$table->longText('content'); | ||
$table->dateTime('created_at')->nullable(); | ||
|
||
$table->unique('uuid'); | ||
$table->index('batch_id'); | ||
$table->index('family_hash'); | ||
$table->index('created_at'); | ||
$table->index(['type', 'should_display_on_index']); | ||
$schema->create("telescope_entries", function (Blueprint $table): void { | ||
$table->bigIncrements("sequence"); | ||
$table->uuid("uuid"); | ||
$table->uuid("batch_id"); | ||
$table->string("family_hash")->nullable(); | ||
$table->boolean("should_display_on_index")->default(true); | ||
$table->string("type", 20); | ||
$table->longText("content"); | ||
$table->dateTime("created_at")->nullable(); | ||
|
||
$table->unique("uuid"); | ||
$table->index("batch_id"); | ||
$table->index("family_hash"); | ||
$table->index("created_at"); | ||
$table->index(["type", "should_display_on_index"]); | ||
}); | ||
|
||
$schema->create('telescope_entries_tags', function (Blueprint $table) { | ||
$table->uuid('entry_uuid'); | ||
$table->string('tag'); | ||
$schema->create("telescope_entries_tags", function (Blueprint $table): void { | ||
$table->uuid("entry_uuid"); | ||
$table->string("tag"); | ||
|
||
$table->primary(['entry_uuid', 'tag']); | ||
$table->index('tag'); | ||
$table->primary(["entry_uuid", "tag"]); | ||
$table->index("tag"); | ||
|
||
$table->foreign('entry_uuid') | ||
->references('uuid') | ||
->on('telescope_entries') | ||
->onDelete('cascade'); | ||
$table->foreign("entry_uuid") | ||
->references("uuid") | ||
->on("telescope_entries") | ||
->onDelete("cascade"); | ||
}); | ||
|
||
$schema->create('telescope_monitoring', function (Blueprint $table) { | ||
$table->string('tag')->primary(); | ||
$schema->create("telescope_monitoring", function (Blueprint $table): void { | ||
$table->string("tag")->primary(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
$schema = Schema::connection($this->getConnection()); | ||
|
||
$schema->dropIfExists('telescope_entries_tags'); | ||
$schema->dropIfExists('telescope_entries'); | ||
$schema->dropIfExists('telescope_monitoring'); | ||
$schema->dropIfExists("telescope_entries_tags"); | ||
$schema->dropIfExists("telescope_entries"); | ||
$schema->dropIfExists("telescope_monitoring"); | ||
} | ||
}; |
27 changes: 11 additions & 16 deletions
27
database/migrations/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 |
---|---|---|
@@ -1,33 +1,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
return new class() extends Migration { | ||
public function up(): void | ||
{ | ||
Schema::create('personal_access_tokens', function (Blueprint $table) { | ||
Schema::create("personal_access_tokens", function (Blueprint $table): void { | ||
$table->id(); | ||
$table->morphs('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->morphs("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'); | ||
Schema::dropIfExists("personal_access_tokens"); | ||
} | ||
}; |