Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alouini333/bf2ef9342d4b8ee93f2a1379ae16d2d3 to your computer and use it in GitHub Desktop.
Save alouini333/bf2ef9342d4b8ee93f2a1379ae16d2d3 to your computer and use it in GitHub Desktop.
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateNotificationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('notifications', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('type');
$table->morphs('notifiable');
$table->text('data');
$table->unsignedBigInteger('tenant_id');
$table->timestamp('read_at')->nullable();
$table->timestamps();
$table->foreign('tenant_id')->references('id')->on('tenants');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('notifications');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment