CreateSocialUsersTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 39
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 21 1
A down() 0 4 1
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
/**
8
 * Class CreateSocialUsersTable.
9
 */
10
class CreateSocialUsersTable 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...
11
{
12
    /**
13
     * Run the migrations.
14
     *
15
     * @return void
16
     */
17
    public function up()
18
    {
19
        Schema::create('social_users', function (Blueprint $table) {
20
            $table->increments('id');
21
            $table->integer('user_id')->unsigned();
22
23
            //Google Social id is so big than can not be stored in a BIGINT so varchar is used!
24
            $table->string('social_id');
25
            $table->string('social_type');
26
            $table->string('nickname')->nullable();
27
            $table->string('name')->nullable();
28
            $table->string('email')->nullable();
29
            $table->string('avatar')->nullable();
30
31
            $table->json('meta');
32
33
            $table->timestamps();
34
35
            $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
36
        });
37
    }
38
39
    /**
40
     * Reverse the migrations.
41
     *
42
     * @return void
43
     */
44
    public function down()
45
    {
46
        Schema::dropIfExists('social_users');
47
    }
48
}
49