CreateNewsTables::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 6
rs 9.4285
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
use jlourenco\base\Database\Blueprint;
4
use Illuminate\Database\Migrations\Migration;
5
6
class CreateNewsTables extends Migration
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
7
{
8
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
17
        Schema::create('News', function (Blueprint $table) {
18
            $table->increments('id');
19
            $table->string('title', 150);
20
            $table->text('body');
21
            $table->integer('image')->unsigned()->nullable();
22
            $table->integer('author')->unsigned();
23
            $table->string('news_list', 150);
24
            $table->timestamp('release_date')->nullable();
25
            $table->timestamps();
26
            $table->softDeletes();
27
28
            $table->foreign('image')->references('id')->on('File');
29
            $table->foreign('author')->references('id')->on('User');
30
        });
31
32
    }
33
34
    /**
35
     * Reverse the migrations.
36
     *
37
     * @return void
38
     */
39
    public function down()
40
    {
41
42
        Schema::drop('News');
43
44
    }
45
46
}
47