CreateBrandsTable::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 9.6
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php namespace VojtaSvoboda\Brands\Updates;
2
3
use Schema;
4
use October\Rain\Database\Schema\Blueprint;
5
use October\Rain\Database\Updates\Migration;
6
7
class CreateBrandsTable extends Migration
8
{
9
    public function up()
10
    {
11
        Schema::create('vojtasvoboda_brands_brands', function(Blueprint $table)
12
        {
13
            $table->engine = 'InnoDB';
14
            $table->increments('id')->unsigned();
15
16
            $table->string('name', 300);
17
            $table->string('slug', 300)->nullable();
18
            $table->text('description', 300)->nullable();
19
            $table->string('external_link', 300)->nullable();
20
            $table->boolean('no_link')->default(false);
21
22
            $table->boolean('enabled')->default(true);
23
            $table->smallInteger('sort_order')->nullable();
24
25
            $table->timestamps();
26
            $table->softDeletes();
27
        });
28
    }
29
30
    public function down()
31
    {
32
        Schema::dropIfExists('vojtasvoboda_brands_brands');
33
    }
34
}
35