Files
exchange-2.0/database/migrations/2022_04_15_211421_create_notifications_table.php
T
2022-04-16 23:53:12 +08:00

41 lines
956 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
class CreateNotificationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('notifications', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->text('description');
$table->morphs('subject');
$table->morphs('target');
$table->morphs('causer');
$table->integer('status')->default(ApprovalStatus::APPROVED);
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('notifications');
}
}