Completed
Push — master ( 3e9e3c...192c50 )
by Abdelrahman
06:42 queued 04:41
created

...5_035322_create_rinvex_fort_socialite_table.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/*
4
 * NOTICE OF LICENSE
5
 *
6
 * Part of the Rinvex Fort Package.
7
 *
8
 * This source file is subject to The MIT License (MIT)
9
 * that is bundled with this package in the LICENSE file.
10
 *
11
 * Package: Rinvex Fort Package
12
 * License: The MIT License (MIT)
13
 * Link:    https://rinvex.com
14
 */
15
16
use Illuminate\Support\Facades\Schema;
17
use Illuminate\Database\Schema\Blueprint;
18
use Illuminate\Database\Migrations\Migration;
19
20
class CreateRinvexFortSocialiteTable 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...
21
{
22
    /**
23
     * Run the migrations.
24
     *
25
     * @return void
26
     */
27
    public function up()
28
    {
29
        Schema::create(config('rinvex.fort.tables.socialite'), function (Blueprint $table) {
30
            // Columns
31
            $table->increments('id');
32
            $table->integer('user_id')->unsigned();
33
            $table->string('provider');
34
            $table->integer('provider_uid')->unsigned();
35
            $table->timestamps();
36
37
            // Indexes
38
            $table->unique([
39
                'provider',
40
                'provider_uid',
41
            ]);
42
            $table->foreign('user_id')
43
                  ->references('id')
44
                  ->on(config('rinvex.fort.tables.users'))
45
                  ->onDelete('cascade')
46
                  ->onUpdate('cascade');
47
48
            // Engine
49
            $table->engine = 'InnoDB';
50
        });
51
    }
52
53
    /**
54
     * Reverse the migrations.
55
     *
56
     * @return void
57
     */
58
    public function down()
59
    {
60
        Schema::drop(config('rinvex.fort.tables.socialite'));
61
    }
62
}
63