From 7112be6ac9a2414a187558ccb66cf698a4ce105b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Thu, 20 May 2021 00:11:22 +0200 Subject: [PATCH] adding --- .../2021_05_09_063140_create_sources_table.php | 2 +- .../2021_05_09_073140_create_actions_table.php | 4 +--- .../2021_05_09_073140_create_logs_table.php | 13 +++++++------ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/database/migrations/2021_05_09_063140_create_sources_table.php b/database/migrations/2021_05_09_063140_create_sources_table.php index b4fae16..69024f7 100644 --- a/database/migrations/2021_05_09_063140_create_sources_table.php +++ b/database/migrations/2021_05_09_063140_create_sources_table.php @@ -19,7 +19,7 @@ class CreateSourcesTable extends Migration $table->string('name'); $table->string('url'); $table->string('response_handler_class'); - $table->dateTime('last_run_at'); + $table->dateTime('lastrun_at'); $table->timestamps(); }); diff --git a/database/migrations/2021_05_09_073140_create_actions_table.php b/database/migrations/2021_05_09_073140_create_actions_table.php index f7aead8..028a832 100644 --- a/database/migrations/2021_05_09_073140_create_actions_table.php +++ b/database/migrations/2021_05_09_073140_create_actions_table.php @@ -22,9 +22,7 @@ class CreateActionsTable extends Migration ])->nullable(); $table->integer('priority'); - // sources - $table->uuid('source_id') - ->nullable(); + $table->unsignedBigInteger('source_id'); $table->foreign('source_id') ->references('id') ->on('sources'); diff --git a/database/migrations/2021_05_09_073140_create_logs_table.php b/database/migrations/2021_05_09_073140_create_logs_table.php index 296996d..5e259ae 100644 --- a/database/migrations/2021_05_09_073140_create_logs_table.php +++ b/database/migrations/2021_05_09_073140_create_logs_table.php @@ -14,16 +14,17 @@ class CreateLogsTable extends Migration public function up() { Schema::create('logs', function (Blueprint $table) { - $table->uuid(); + $table->id(); - $tabke->json('message'); + $table->json('message'); $table->enum('state', [ - 'critical', 'solved', 'error' + 'critical', 'info', 'error' ]); - // sources - $table->uuid('source_id')->nullable(); - $table->foreign('source_id')->references('id')->on('sources'); + $table->unsignedBigInteger('source_id'); + $table->foreign('source_id') + ->references('id') + ->on('sources'); $table->timestamps(); });