v2 first commit

This commit is contained in:
denisdulici
2019-11-16 10:21:14 +03:00
parent 5b23e9c2c4
commit 6d50fa8442
3075 changed files with 3451681 additions and 65594 deletions

View File

@ -0,0 +1,53 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateFirewallTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('firewall_ips', function (Blueprint $table) {
$table->increments('id');
$table->string('ip');
$table->integer('log_id')->nullable();
$table->boolean('blocked')->default(1);
$table->timestamps();
$table->softDeletes();
$table->index('ip');
$table->unique(['ip', 'deleted_at']);
});
Schema::create('firewall_logs', function (Blueprint $table) {
$table->increments('id');
$table->string('ip');
$table->string('level')->default('medium');
$table->string('middleware');
$table->integer('user_id')->nullable();
$table->string('url')->nullable();
$table->string('referrer')->nullable();
$table->text('request')->nullable();
$table->timestamps();
$table->softDeletes();
$table->index('ip');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('firewall_ips');
Schema::drop('firewall_logs');
}
}