MakeSettingsNameUnique::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 7
rs 9.4286
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
class MakeSettingsNameUnique extends Migration
7
{
8
    /**
9
     * Run the migrations.
10
     * @return void
11
     */
12
    public function up()
13
    {
14
        Schema::table('setting__settings', function (Blueprint $table) {
15
            $table->unique('name', 'setting__settings_name_unique');
16
            $table->index('name', 'setting__settings_name_index');
17
        });
18
    }
19
20
    /**
21
     * Reverse the migrations.
22
     * @return void
23
     */
24
    public function down()
25
    {
26
        Schema::table('setting__settings', function (Blueprint $table) {
27
            $table->dropUnique('setting__settings_name_unique');
28
            $table->dropIndex('setting__settings_name_index');
29
        });
30
    }
31
}
32