41 lines
1.1 KiB
PHP
Executable File
41 lines
1.1 KiB
PHP
Executable File
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
public function up()
|
|
{
|
|
Schema::create('notificaciones', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->unsignedBigInteger('remitente_id')->nullable();
|
|
$table->unsignedBigInteger('destinatario_id')->nullable();
|
|
$table->string('titulo')->nullable();
|
|
$table->text('descripcion')->nullable();
|
|
$table->boolean('estado')->default(true);
|
|
$table->boolean('todos')->default(false);
|
|
|
|
$table->foreign('remitente_id')
|
|
->references('id')
|
|
->on('users')
|
|
->onDelete('cascade')
|
|
->onUpdate('cascade');
|
|
|
|
$table->foreign('destinatario_id')
|
|
->references('id')
|
|
->on('users')
|
|
->onDelete('cascade')
|
|
->onUpdate('cascade');
|
|
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('notificaciones');
|
|
}
|
|
};
|