CreateSchedulesTable::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 12
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * Esse arquivo faz parte do Scheduler,
5
 * uma biblioteca para auxiliar com agendamentos.
6
 *
7
 * @license MIT
8
 * @package H4ad\Scheduler
9
 */
10
11
use Illuminate\Support\Facades\Config;
12
use Illuminate\Support\Facades\Schema;
13
use Illuminate\Database\Schema\Blueprint;
14
use Illuminate\Database\Migrations\Migration;
15
16
class CreateSchedulesTable extends Migration
17
{
18
    /**
19
     * Run the migrations.
20
     *
21
     * @return void
22
     */
23
    public function up()
24
    {
25
        Schema::create(Config::get('scheduler.schedules_table'), function (Blueprint $table) {
26
            $table->increments('id');
27
            $table->string('model_type');
28
            $table->integer('model_id');
29
            $table->timestamp('start_at');
30
            $table->timestamp('end_at')->nullable();
31
            $table->integer('status')->nullable();
32
            $table->json('data')->nullable();
33
            $table->timestamps();
34
            $table->softDeletes();
35
        });
36
    }
37
38
    /**
39
     * Reverse the migrations.
40
     *
41
     * @return void
42
     */
43
    public function down()
44
    {
45
        Schema::drop(Config::get('scheduler.schedules_table'));
46
    }
47
}