Completed
Push — version-4 ( 5bb021 )
by
unknown
08:16
created

AlterCategoryNameToUnique::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
5
class AlterCategoryNameToUnique extends Migration
6
{
7
    /**
8
     * Run the migrations.
9
     *
10
     * @return void
11
     */
12
    public function up()
13
    {
14
        Schema::table('notification_categories', function ($table) {
15
            $table->unique('name');
16
        });
17
    }
18
19
    /**
20
     * Reverse the migrations.
21
     *
22
     * @return void
23
     */
24
    public function down()
25
    {
26
        Schema::table('notification_categories', function ($table) {
27
            $table->dropUnique('notification_categories_name_unique');
28
        });
29
    }
30
}
31