UpdateUserTable::down()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 6
Ratio 66.67 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 0
dl 6
loc 9
rs 9.9666
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\DB;
6
use Illuminate\Support\Facades\Schema;
7
8
class UpdateUserTable extends Migration
9
{
10
    public function up()
11
    {
12
        DB::connection()->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
13
14 View Code Duplication
        if (Schema::hasTable('users')) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
15
            Schema::table('users', function (Blueprint $table) {
16
                $table->string('password', 255)->nullable()->change();
17
                $table->string('mail', 255)->change();
18
            });
19
        }
20
    }
21
22
    public function down()
23
    {
24 View Code Duplication
        if (Schema::hasTable('users')) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
25
            Schema::table('users', function (Blueprint $table) {
26
                $table->string('password', 64)->nullable(false)->change();
27
                $table->string('mail', 50)->change();
28
            });
29
        }
30
    }
31
}
32