Total Complexity | 2 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
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() |
||
39 | // This change is not reversible |
||
40 | } |
||
42 |