fix: statisc
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('page_visits', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('channel_id', 64);
|
||||
$table->string('client_uid', 64);
|
||||
$table->string('user_agent', 512)->nullable();
|
||||
$table->string('os', 32)->nullable();
|
||||
$table->string('os_version', 32)->nullable();
|
||||
$table->string('browser', 32)->nullable();
|
||||
$table->string('browser_version', 32)->nullable();
|
||||
$table->string('ip', 45)->nullable();
|
||||
$table->string('path', 255)->nullable();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
|
||||
$table->index(['channel_id', 'created_at']);
|
||||
$table->index(['client_uid', 'created_at']);
|
||||
$table->index(['os', 'os_version']);
|
||||
$table->index(['browser', 'browser_version']);
|
||||
$table->index('created_at');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('page_visits');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user