FEATURE: add simple view for requests and queries
This commit is contained in:
+35
@@ -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');
|
||||
});
|
||||
}
|
||||
}
|
||||
+43
@@ -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');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user