Completed
Push — master ( 3b9644...b65440 )
by Zach
07:24 queued 02:31
created

CreateTextBlocksTable::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 14

Duplication

Lines 18
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 14
nc 1
nop 0
dl 18
loc 18
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class CreateTextBlocksTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('text_blocks', function (Blueprint $table) {
17
            $table->increments('id');
18
            $table->string('name')->index();
19
            $table->text('text');
20
            $table->text('formatted_text');
21
            $table->integer('order');
22
            $table->integer('project_id')->nullable()->unsigned()->index();
23
            $table->timestamp('deleted_at')->nullable();
24
            $table->timestamps();
25
26
            $table->foreign('project_id')
27
              ->references('id')
28
              ->on('projects')
29
              ->onDelete('cascade');
30
        });
31
    }
32
33
    /**
34
     * Reverse the migrations.
35
     *
36
     * @return void
37
     */
38
    public function down()
39
    {
40
        Schema::dropIfExists('text_blocks');
41
    }
42
}
43