CreatePagesPagesTable::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 12
nc 1
nop 0
1
<?php
2
3
use Arcanesoft\Pages\Bases\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
/**
7
 * Class     CreatePagesTable
8
 *
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class CreatePagesPagesTable extends Migration
12
{
13
    /* ------------------------------------------------------------------------------------------------
14
     |  Constructor
15
     | ------------------------------------------------------------------------------------------------
16
     */
17
    /**
18
     * CreatePagesPagesTable constructor.
19
     */
20
    public function __construct()
21
    {
22
        parent::__construct();
23
24
        $this->setTable('pages');
25
    }
26
27
    /* ------------------------------------------------------------------------------------------------
28
     |  Main Functions
29
     | ------------------------------------------------------------------------------------------------
30
     */
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function up()
35
    {
36
        $this->createSchema(function (Blueprint $table) {
37
            $table->engine = 'InnoDB';
38
39
            $table->increments('id');
40
            $table->integer('author_id')->unsigned();
41
            $table->string('title');
42
            $table->string('slug');
43
            $table->text('content');
44
            $table->string('template')->nullable();
45
            $table->timestamps();
46
            $table->softDeletes();
47
48
            $table->unique('slug');
49
        });
50
    }
51
}
52