Completed
Pull Request — master (#372)
by Mike
31:01 queued 16:07
created

CreateActionEventsTable::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
class CreateActionEventsTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('action_events', function (Blueprint $table) {
17
            $table->id();
18
            $table->char('batch_id', 36);
19
            $table->unsignedBigInteger('user_id')->index();
20
            $table->string('name');
21
            $table->string('actionable_type');
22
            $table->unsignedBigInteger('actionable_id');
23
            $table->string('target_type');
24
            $table->unsignedBigInteger('target_id');
25
            $table->string('model_type');
26
            $table->unsignedBigInteger('model_id')->nullable();
27
            $table->text('fields');
28
            $table->string('status', 25)->default('running');
29
            $table->text('exception');
30
            $table->timestamps();
31
32
            $table->index(['actionable_type', 'actionable_id']);
33
            $table->index(['batch_id', 'model_type', 'model_id']);
34
        });
35
    }
36
37
    /**
38
     * Reverse the migrations.
39
     *
40
     * @return void
41
     */
42
    public function down()
43
    {
44
        Schema::dropIfExists('action_events');
45
    }
46
}
47