File: /var/www/admin.javaapp.co.uk/database/migrations/2023_03_01_115429_create_notifications_table.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()
{
Schema::create('notifications', function (Blueprint $table) {
$table->id();
$table->integer('sender_id')->default(0);
$table->integer('receiver_id')->default(0);
$table->integer('reference_id')->default(0);
$table->tinyInteger('notification_type')->default(0)->comment('1 = new order (cafe admin), 2 = new coffee run request, 3 = manage loyalty stamp (from cafe to user), 4 = universal loyalty stamp (from admin to user)');
$table->tinyInteger('is_read')->default(0)->comment('1 = read, 0 = unread');
$table->unsignedInteger('deleted_at')->default(0);
$table->unsignedInteger('created_at')->default(0);
$table->unsignedInteger('updated_at')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('notifications');
}
};