Passed
Push — master ( c36ed8...8867a0 )
by Quentin
13:25 queued 05:48
created

ChangeLocaleColumnInTwillFileables   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 16
rs 10
wmc 6
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
class ChangeLocaleColumnInTwillFileables extends Migration
7
{
8
    public function up()
9
    {
10
        if (Schema::hasTable('fileables') && Schema::hasColumn('fileables', 'locale')) {
11
            Schema::table('fileables', function (Blueprint $table) {
12
                $table->string('locale', 7)->change();
13
            });
14
        }
15
    }
16
17
    public function down()
18
    {
19
        if (Schema::hasTable('fileables') && Schema::hasColumn('fileables', 'locale')) {
20
            Schema::table('fileables', function (Blueprint $table) {
21
                $table->string('locale', 6)->change();
22
            });
23
        }
24
    }
25
}
26