Lae/database/migrations/2023_02_02_000000_create_notifications_table.php
2023-02-02 20:11:41 +08:00

37 lines
856 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.
*
* @return void
*/
public function up(): void
{
Schema::create('notifications', function (Blueprint $table) {
$table->uuid()->primary();
$table->string('type');
$table->string('notifiable_type')->index();
$table->unsignedBigInteger('notifiable_id')->index();
$table->text('data');
$table->timestamp('read_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{
Schema::dropIfExists('notifications');
}
};