Completed
Push — master ( 9e824f...e5e282 )
by Ryan
16:21 queued 07:50
created

CreateJobsTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 2
dl 0
loc 36
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 17 1
A down() 0 4 1
1
<?php
2
3
use Anomaly\Streams\Platform\Database\Migration\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
/**
7
 * Class CreateJobsTable
8
 *
9
 * @link          http://anomaly.is/streams-platform
10
 * @author        AnomalyLabs, Inc. <[email protected]>
11
 * @author        Ryan Thompson <[email protected]>
12
 */
13
class CreateJobsTable extends Migration
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
14
{
15
16
    /**
17
     * Run the migrations.
18
     *
19
     * @return void
20
     */
21
    public function up()
22
    {
23
        Schema::create(
24
            'jobs',
25
            function (Blueprint $table) {
26
                $table->bigIncrements('id');
27
                $table->unsignedInteger('created_at');
28
                $table->unsignedInteger('available_at');
29
                $table->unsignedInteger('reserved_at')->nullable();
30
                $table->string('queue');
31
                $table->longText('payload');
32
                $table->tinyInteger('attempts')->unsigned();
33
                $table->tinyInteger('reserved')->unsigned();
34
                $table->index(['queue', 'reserved', 'reserved_at']);
35
            }
36
        );
37
    }
38
39
    /**
40
     * Reverse the migrations.
41
     *
42
     * @return void
43
     */
44
    public function down()
45
    {
46
        Schema::drop('jobs');
47
    }
48
}
49