Browse Source

adding

master
Björn 3 years ago
parent
commit
7112be6ac9
3 changed files with 9 additions and 10 deletions
  1. +1
    -1
      database/migrations/2021_05_09_063140_create_sources_table.php
  2. +1
    -3
      database/migrations/2021_05_09_073140_create_actions_table.php
  3. +7
    -6
      database/migrations/2021_05_09_073140_create_logs_table.php

+ 1
- 1
database/migrations/2021_05_09_063140_create_sources_table.php View File

@ -19,7 +19,7 @@ class CreateSourcesTable extends Migration
$table->string('name'); $table->string('name');
$table->string('url'); $table->string('url');
$table->string('response_handler_class'); $table->string('response_handler_class');
$table->dateTime('last_run_at');
$table->dateTime('lastrun_at');
$table->timestamps(); $table->timestamps();
}); });


+ 1
- 3
database/migrations/2021_05_09_073140_create_actions_table.php View File

@ -22,9 +22,7 @@ class CreateActionsTable extends Migration
])->nullable(); ])->nullable();
$table->integer('priority'); $table->integer('priority');
// sources
$table->uuid('source_id')
->nullable();
$table->unsignedBigInteger('source_id');
$table->foreign('source_id') $table->foreign('source_id')
->references('id') ->references('id')
->on('sources'); ->on('sources');


+ 7
- 6
database/migrations/2021_05_09_073140_create_logs_table.php View File

@ -14,16 +14,17 @@ class CreateLogsTable extends Migration
public function up() public function up()
{ {
Schema::create('logs', function (Blueprint $table) { Schema::create('logs', function (Blueprint $table) {
$table->uuid();
$table->id();
$tabke->json('message');
$table->json('message');
$table->enum('state', [ $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(); $table->timestamps();
}); });


Loading…
Cancel
Save