Lae/database/migrations/2023_02_02_201951_create_notifications_table.php

36 lines
768 B
PHP
Raw Normal View History

2022-08-13 08:37:17 +00:00
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
2023-01-30 16:14:07 +00:00
return new class extends Migration
{
2022-08-13 08:37:17 +00:00
/**
* Run the migrations.
*
* @return void
*/
2023-02-02 12:20:03 +00:00
public function up()
2022-08-13 08:37:17 +00:00
{
2022-08-13 08:42:23 +00:00
Schema::create('notifications', function (Blueprint $table) {
2023-02-02 12:20:03 +00:00
$table->uuid('id')->primary();
2022-08-13 08:42:23 +00:00
$table->string('type');
2023-02-02 12:20:03 +00:00
$table->morphs('notifiable');
2022-08-13 08:42:23 +00:00
$table->text('data');
$table->timestamp('read_at')->nullable();
2022-08-13 08:37:17 +00:00
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
2023-02-02 12:20:03 +00:00
public function down()
2022-08-13 08:37:17 +00:00
{
2022-08-13 08:42:23 +00:00
Schema::dropIfExists('notifications');
2022-08-13 08:37:17 +00:00
}
};