29 lines
816 B
PHP
29 lines
816 B
PHP
<?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('notifiche', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->unsignedBigInteger('user_id')->nullable();
|
|
$table->string('tipo');
|
|
$table->string('titolo');
|
|
$table->text('messaggio');
|
|
$table->string('link')->nullable();
|
|
$table->boolean('is_read')->default(false);
|
|
$table->timestamp('read_at')->nullable();
|
|
$table->timestamps();
|
|
$table->index('user_id');
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('notifiche');
|
|
}
|
|
}; |