HoshiAI-be/database/migrations/2025_11_11_094046_create_hitcounts_table.php

33 lines
789 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.
*/
public function up(): void
{
Schema::create('hitcounts', function (Blueprint $table) {
$table->id();
$table->string('ip', 40);
$table->enum('device_type', ['tablet', 'desktop', 'phone']);
$table->string('user_agent', 255);
$table->string('country', 255)->nullable();
$table->string('url', 255);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('hitcounts');
}
};