Passed
Branch master (549a47)
by Robert
13:30
created

CreateTaggedTable   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 18
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A 2014_01_07_073615_create_tagged_table.php$0 ➔ up() 0 12 2
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
return new class extends Migration
7
{
8
    public function up()
9
    {
10
        Schema::create('tagging_tagged', function (Blueprint $table) {
11
            $table->increments('id');
12
            if (config('tagging.primary_keys_type') == 'string') {
13
                $table->string('taggable_id', 36)->index();
14
            } else {
15
                $table->integer('taggable_id')->unsigned()->index();
16
            }
17
            $table->string('taggable_type', 125)->index();
18
            $table->string('tag_name', 125);
19
            $table->string('tag_slug', 125)->index();
20
        });
21
    }
22
23
    public function down()
24
    {
25
        Schema::drop('tagging_tagged');
26
    }
27
};
28