CreateCategoriesTableMigration::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 1
f 0
1
<?php
2
3
use Phpmig\Migration\Migration;
4
use Illuminate\Database\Capsule\Manager as Capsule;
5
6
class CreateCategoriesTableMigration extends Migration
7
{
8
    /**
9
     * Do the migration
10
     */
11
    public function up()
12
    {
13
        Capsule::schema()->create('categories', function ($table) {
14
            $table->increments('id');
15
            $table->string('title')->nullable();
16
            $table->string('slug')->unique();
17
            $table->text('body')->nullable();
18
            $table->integer('item_cnt')->unsigned()->default(0);
19
            $table->enum('is_active',['yes','no'])->default('yes');
20
            $table->enum('has_pic',['yes','no'])->default('no');
21
22
            $table->string('meta_title',128)->nullable();
23
            $table->string('meta_description',256)->nullable();
24
            $table->string('meta_keywords',64)->nullable();
25
26
            /*Add Soft Delete To Articles*/
27
            $table->softDeletes();
28
            $table->timestamps();
29
        });
30
31
32
    }
33
34
    /**
35
     * Undo the migration
36
     */
37
    public function down()
38
    {
39
        Capsule::schema()->drop('categories');
40
    }
41
}