1
1
<?php
2
2
3
+ use Illuminate \Database \Migrations \Migration ;
4
+ use Illuminate \Database \Schema \Blueprint ;
3
5
use Illuminate \Support \Facades \DB ;
4
6
use Illuminate \Support \Facades \Schema ;
5
- use Illuminate\Database\Schema\Blueprint;
6
- use Illuminate\Database\Migrations\Migration;
7
7
8
- class AddLdapColumnsToUsersTable extends Migration
8
+ return new class extends Migration
9
9
{
10
10
/**
11
11
* Run the migrations.
12
- *
13
- * @return void
14
12
*/
15
- public function up()
13
+ public function up (): void
16
14
{
17
15
$ driver = Schema::getConnection ()->getDriverName ();
18
16
@@ -34,10 +32,8 @@ public function up()
34
32
35
33
/**
36
34
* Reverse the migrations.
37
- *
38
- * @return void
39
35
*/
40
- public function down()
36
+ public function down (): void
41
37
{
42
38
Schema::table ('users ' , function (Blueprint $ table ) {
43
39
$ table ->dropColumn (['guid ' , 'domain ' ]);
@@ -46,13 +42,8 @@ public function down()
46
42
47
43
/**
48
44
* Compile a compatible "unique" SQL Server index constraint.
49
- *
50
- * @param string $table
51
- * @param string $column
52
- *
53
- * @return string
54
45
*/
55
- protected function compileUniqueSqlServerIndexStatement($table, $column)
46
+ protected function compileUniqueSqlServerIndexStatement (string $ table , string $ column ): string
56
47
{
57
48
return sprintf ('create unique index %s on %s (%s) where %s is not null ' ,
58
49
implode ('_ ' , [$ table , $ column , 'unique ' ]),
@@ -61,4 +52,4 @@ protected function compileUniqueSqlServerIndexStatement($table, $column)
61
52
$ column
62
53
);
63
54
}
64
- }
55
+ };
0 commit comments