Passed
Push — master ( 226de9...9c76cb )
by Arpad
03:40
created

CreatePostsTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

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