Completed
Push — master ( 7e54ec...8b45a6 )
by Vojta
9s
created

CreateCategoriesTable::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

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