Completed
Push — master ( c5c126...29bff4 )
by Edson
01:37
created

TweetSchema   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 15 1
A down() 0 3 1
1
<?php
2
3
namespace Bonfim\ActiveRecord\Examples\Database\Migrations;
4
5
use Bonfim\ActiveRecord\Schema;
6
7
class TweetSchema extends Schema
8
{
9
    function up()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
10
    {
11
        $this->create('tweets', function ($table) {
12
            $table->increments();
13
14
            $table
15
                ->integer('user_id')
16
//                ->unsigned()
17
                ->notNull()
18
                ->references('users', 'id')
19
                ->onUpdate('CASCADE')
20
                ->onDelete('CASCADE');
21
22
            $table->string('content', 240)->notNull();
23
            $table->timestamps();
24
        });
25
    }
26
27
    function down()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
28
    {
29
        echo 'down';
30
    }
31
}
32