CreateBlogPostTagPivot   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 35
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A up() 0 9 1
1
<?php
2
3
use Arcanesoft\Blog\Bases\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
/**
7
 * Class     CreateBlogTagsTable
8
 *
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class CreateBlogPostTagPivot extends Migration
12
{
13
    /* -----------------------------------------------------------------
14
     |  Constructor
15
     | -----------------------------------------------------------------
16
     */
17
18
    /**
19
     * CreateBlogTagsTable constructor.
20
     */
21
    public function __construct()
22
    {
23
        parent::__construct();
24
25
        $this->setTable('post_tag');
26
    }
27
28
    /* -----------------------------------------------------------------
29
     |  Main Methods
30
     | -----------------------------------------------------------------
31
     */
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    public function up()
37
    {
38
        $this->createSchema(function(Blueprint $table) {
39
            $table->unsignedInteger('post_id');
40
            $table->unsignedInteger('tag_id');
41
42
            $table->primary(['post_id', 'tag_id']);
43
        });
44
    }
45
}
46