Passed
Push — main ( 3cfdb8...a45320 )
by PRATIK
10:34
created

CreatePostsTable::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
class CreatePostsTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('posts', function (Blueprint $table) {
17
            $table->id();
18
            $table->string('slug')->unique();
19
            $table->string('code')->unique();
20
            $table->unsignedBigInteger('author_id');
21
            $table->unsignedBigInteger('category_id');
22
            $table->string('name');
23
            $table->text('excerpt');
24
            $table->text('body')->nullable();
25
            $table->string('image')->nullable();
26
            $table->integer('status')->default(1);
27
            $table->boolean('featured')->default(0);
28
            $table->bigInteger('priority')->default(1);
29
            $table->integer('type')->default(1);
30
            $table->string('video')->nullable();
31
            $table->string('audio')->nullable();
32
            $table->boolean('breaking_news')->default(0);
33
            $table->boolean('hot_news')->default(0);
34
            $table->string('seo_name')->nullable();
35
            $table->text('meta_description')->nullable();
36
            $table->json('meta_keywords')->nullable();
37
            $table->timestamps();
38
        });
39
    }
40
41
    /**
42
     * Reverse the migrations.
43
     *
44
     * @return void
45
     */
46
    public function down()
47
    {
48
        Schema::dropIfExists('posts');
49
    }
50
}
51