Created
January 19, 2020 16:45
-
-
Save alouini333/bf2ef9342d4b8ee93f2a1379ae16d2d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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