Files
portal-api/database/migrations/2024_01_31_145738_user_log.php
2025-07-24 16:18:27 +07:00

42 lines
993 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
Schema::create('log',function (Blueprint $table){
$table->id()->autoIncrement();
$table->string('agent')->nullable();
$table->string('client_ip',100)->nullable();
$table->string('username',100)->nullable();
$table->text('description')->nullable();
$table->bigInteger('customer_id')->default(0)->index();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
Schema::table('log',function (Blueprint $table){
$table->dropForeign('customer_id');
$table->drop();
});
}
};