Passed
Push — master ( 209004...29c5b8 )
by Christopher
01:22
created

CreateTriadevElasticsearchMigrationStepTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 18
dl 0
loc 39
c 0
b 0
f 0
rs 10
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
class CreateTriadevElasticsearchMigrationStepTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::enableForeignKeyConstraints();
17
        
18
        Schema::create('triadev_elasticsearch_migration_step', function (Blueprint $table) {
19
            $table->bigIncrements('id');
20
            $table->unsignedBigInteger('migration_id');
21
            $table->string('type');
22
            $table->integer('status')->default(
23
                \Triadev\EsMigration\Business\Mapper\MigrationStatus::MIGRATION_STATUS_WAIT
24
            );
25
            $table->text('error')->nullable();
26
            $table->text('params');
27
            $table->integer('priority')->default(1);
28
            $table->boolean('stop_on_failure')->default(true);
29
            $table->timestamps();
30
            
31
            $table->foreign('migration_id')
32
                ->references('id')
33
                ->on('triadev_elasticsearch_migration')
34
                ->onDelete('cascade');
35
        });
36
    }
37
38
    /**
39
     * Reverse the migrations.
40
     *
41
     * @return void
42
     */
43
    public function down()
44
    {
45
        Schema::drop('triadev_elasticsearch_migration_step');
46
    }
47
}
48