AlterUsersTableForAzureAd::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
class AlterUsersTableForAzureAd extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::table('users', function (Blueprint $table) {
17
            // Users must be able to support blank passwords for external identity
18
            $table->string('password')->nullable()->change();
19
            // We need a new string field to store the oauth provider unique id in
20
            $table->string('azure_id', 36)
21
                  ->nullable()
22
                  ->after('email');
23
            // We need a new string field to store the user principal name in
24
            $table->string('userPrincipalName')
25
                  ->nullable()
26
                  ->after('azure_id');
27
        });
28
        // We dont support password resets because social identity is external
29
        Schema::dropIfExists('password_resets');
30
    }
31
32
    /**
33
     * Reverse the migrations.
34
     *
35
     * @return void
36
     */
37
    public function down()
38
    {
39
        // This change is not reversible
40
    }
41
}
42