first commit
This commit is contained in:
@@ -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');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user