Completed
Push — master ( 533f80...ba63a0 )
by Ricardo
04:00
created

CreateWorkflowTables::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 32

Duplication

Lines 22
Ratio 68.75 %

Importance

Changes 0
Metric Value
dl 22
loc 32
rs 9.408
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class CreateWorkflowTables extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
17
        Schema::create(
18 View Code Duplication
            'workflows', function (Blueprint $table) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
19
                $table->increments('id');
20
                $table->string('name');
21
                $table->integer('inicial_stage_id');
22
                $table->integer('status')->default(1);
23
                $table->timestamps();
24
            }
25
        );
26
        Schema::create(
27 View Code Duplication
            'workflow_item_types', function (Blueprint $table) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
28
                $table->increments('id');
29
                $table->string('model');
30
                $table->string('filter')->nullable();
31
                $table->integer('status')->default(1);
32
                $table->timestamps();
33
            }
34
        );
35
        Schema::create(
36 View Code Duplication
            'workflow_transactions', function (Blueprint $table) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
37
                $table->increments('id');
38
                $table->string('name');
39
                $table->integer('workflow_id')->nullable();
40
                $table->integer('stage_from_id')->nullable();
41
                $table->integer('stage_to_id')->nullable();
42
                $table->timestamps();
43
            }
44
        );
45
    }
46
47
    /**
48
     * Reverse the migrations.
49
     *
50
     * @return void
51
     */
52
    public function down()
53
    {
54
        Schema::dropIfExists('workflow_item_types');
55
    }
56
}
57