first commit

This commit is contained in:
Stefanescu Mihai
2026-03-18 10:56:35 +02:00
commit 18f43d0891
74 changed files with 11850 additions and 0 deletions
@@ -0,0 +1,35 @@
<?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('events', function (Blueprint $table) {
$table->id();
$table->foreignId('website_id')->constrained()->cascadeOnDelete();
$table->foreignId('visitor_id')->constrained()->cascadeOnDelete();
$table->foreignId('analytics_session_id')->constrained()->cascadeOnDelete();
$table->string('name');
$table->string('category')->nullable();
$table->string('action')->nullable();
$table->string('label')->nullable();
$table->decimal('value', 15, 4)->nullable();
$table->json('properties')->nullable();
$table->timestamp('occurred_at');
$table->timestamps();
$table->index(['website_id', 'name', 'occurred_at']);
$table->index(['website_id', 'occurred_at']);
$table->index('category');
});
}
public function down(): void
{
Schema::dropIfExists('events');
}
};