v0.1.10
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?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
|
||||
{
|
||||
\kernel\App::$db->schema->create('notification', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
// Связь с пользователем
|
||||
$table->unsignedBigInteger('user_id');
|
||||
|
||||
// Основные данные уведомления
|
||||
$table->string('type')->index(); // Класс уведомления (например, App\Notifications\OrderCreated)
|
||||
$table->text('message'); // Текст уведомления
|
||||
$table->string('subject')->nullable(); // Тема (для email)
|
||||
$table->json('data')->nullable(); // Дополнительные данные в JSON
|
||||
|
||||
// Статус уведомления
|
||||
$table->boolean('is_read')->default(false);
|
||||
$table->integer('status')->default(1);
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
\kernel\App::$db->schema->dropIfExists('notification');
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user