CreatePostsTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 17
dl 0
loc 30
c 1
b 0
f 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 17 1
A down() 0 3 1
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
     * Reverse the migrations.
11
     */
12
    public function down()
13
    {
14
        Schema::dropIfExists('posts');
15
    }
16
17
    /**
18
     * Run the migrations.
19
     */
20
    public function up()
21
    {
22
        Schema::create('posts', function (Blueprint $table) {
23
            $table->bigIncrements('id');
24
            $table->string('title', 255);
25
            $table->string('slug', 255);
26
            $table->text('text');
27
            $table->datetime('publish_date')->nullable();
28
            $table->tinyInteger('published');
29
            $table->tinyInteger('tweet_sent')->default(0);
30
            $table->tinyInteger('posted_on_medium')->default(0);
31
            $table->string('author', 255);
32
            $table->timestamp('created_at')->nullable();
33
            $table->timestamp('updated_at')->nullable();
34
            $table->tinyInteger('original_content')->default(0);
35
            $table->string('external_url', 255)->nullable();
36
            $table->string('tweet_url', 255)->nullable();
37
        });
38
    }
39
}
40