From 3f3d500c82cc94bfa396cc59cccd83ea03dea0e2 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Fri, 2 Sep 2022 00:42:42 +0200 Subject: [PATCH] Add telescope_entries table --- ..._100000_create_telescope_entries_table.php | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 database/migrations/2018_08_08_100000_create_telescope_entries_table.php diff --git a/database/migrations/2018_08_08_100000_create_telescope_entries_table.php b/database/migrations/2018_08_08_100000_create_telescope_entries_table.php new file mode 100644 index 00000000..4b59119e --- /dev/null +++ b/database/migrations/2018_08_08_100000_create_telescope_entries_table.php @@ -0,0 +1,61 @@ +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'); + + $table->index(['entry_uuid', 'tag']); + $table->index('tag'); + + $table->foreign('entry_uuid') + ->references('uuid') + ->on('telescope_entries') + ->onDelete('cascade'); + }); + + Schema::create('telescope_monitoring', function (Blueprint $table) { + $table->string('tag'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('telescope_entries_tags'); + Schema::dropIfExists('telescope_entries'); + Schema::dropIfExists('telescope_monitoring'); + } +};