Edit File: 2024_09_01_164034_create_search_histories_table.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('search_histories', function (Blueprint $table) { $table->id(); $table->tinyInteger('search_for')->default(1)->comment(' 1 = store, 2 = product'); $table->foreignId('user_id')->nullable()->constrained()->onDelete('cascade'); $table->string('keyword')->nullable(); // MAY NOT USE THIS $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('search_histories'); } };
Back to File Manager