notificaciones migracion y maquetado y modelo

This commit is contained in:
Felipe
2023-10-23 10:29:15 -05:00
parent ff00f91eed
commit 1d3fac965d
6 changed files with 129 additions and 3 deletions
@@ -15,12 +15,12 @@ return new class extends Migration
{
Schema::create('pendientes', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('historial_id')->nullable();;
$table->unsignedBigInteger('servicio_id')->nullable();;
$table->unsignedBigInteger('historial_id')->nullable();
$table->unsignedBigInteger('servicio_id')->nullable();
$table->string('cantidad')->nullable();
$table->string('estado')->nullable();
$table->foreign('historial_id')->references('id')->on('historiales')->onDelete('cascade');
$table->foreign('servicio_id')->references('id')->on('servicios')->onUpdate('cascade');;
$table->foreign('servicio_id')->references('id')->on('servicios')->onUpdate('cascade');
$table->timestamps();
});
}
@@ -0,0 +1,50 @@
<?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()
{
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();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('notificaciones');
}
};