Completed
Push — master ( f89f2d...eac518 )
by Nicolas
01:55
created

CreatePolarNotificationsTable::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 12
nc 1
nop 0
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class CreatePolarNotificationsTable extends Migration
8
{
9
    public function up()
10
    {
11
        Schema::create('polar_notifications', function (Blueprint $table) {
12
            $table->bigIncrements('id');
13
14
            $table->integer('user_id', false, true);
15
            $table->string('from')->default('system');
16
            $table->string('status', 10)->defaul('info');
17
            $table->text('body');
18
            $table->string('url')->nullable();
19
            $table->json('extra');
20
            $table->tinyInteger('read')->default(0);
21
22
            $table->timestamps();
23
            $table->index(['user_id', 'created_at']);
24
        });
25
    }
26
27
    public function down()
28
    {
29
        Schema::dropIfExists('polar_notifications');
30
    }
31
}
32