FEATURE: add simple view for requests and queries

This commit is contained in:
Michal Kváček
2017-03-02 20:04:35 +01:00
parent d99c046103
commit 9c90e844b0
23 changed files with 347 additions and 54 deletions
@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class UpdateHttpLogAddLoadAvg extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('http_log', function (Blueprint $table) {
$table->double('load_1')->nullable();
$table->double('load_5')->nullable();
$table->double('load_15')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('http_log', function (Blueprint $table) {
$table->dropColumn('load_1');
$table->dropColumn('load_5');
$table->dropColumn('load_15');
});
}
}
@@ -0,0 +1,43 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class UpdateQueryLogAddRequestId extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('queries_log', function (Blueprint $table) {
$table->integer('http_log_id')
->nullable()
->unsigned()
->after('id')
->comment('FK to http_log');
$table->foreign('http_log_id')
->references('id')
->on('http_log')
->onDelete('cascade')
->onUpdate('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('queries_log', function (Blueprint $table) {
// $table->dropForeign('');
$table->dropColumn('http_log_id');
});
}
}