CreateNotificationsTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 45
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 27 1
A down() 0 4 1
1
<?php
2
3
use Illuminate\Database\Schema\Blueprint;
4
use Illuminate\Database\Migrations\Migration;
5
6
class CreateNotificationsTable extends Migration
7
{
8
    /**
9
     * Run the migrations.
10
     *
11
     * @return void
12
     */
13
    public function up()
14
    {
15
        Schema::create('notifications', function (Blueprint $table) {
16
            $table->increments('id');
17
18
            $table->string('flag');
19
            $table->string('uuid');
20
            $table->string('title');
21
            $table->text('details')->nullable();
22
            $table->boolean('is_read')->default(false);
23
24
            $table->string('notificable_id');
25
            $table->string('notificable_type');
26
            $table->softDeletes();
27
            $table->timestamps();
28
        });
29
        // Schema::create('notifications', function (Blueprint $table) {
30
        //     $table->increments('id');
31
        //     $table->integer('from_user_id')->index();
32
        //     $table->integer('user_id')->index();
33
        //     $table->integer('topic_id')->index();
34
        //     $table->integer('reply_id')->nullable()->index();
35
        //     $table->text('body')->nullable();
36
        //     $table->string('type')->index();
37
        //     $table->timestamps();
38
        // });
39
    }
40
41
    /**
42
     * Reverse the migrations.
43
     *
44
     * @return void
45
     */
46
    public function down()
47
    {
48
        Schema::dropIfExists('notifications');
49
    }
50
}
51