Completed
Push — version-4 ( d6d949...f39f28 )
by
unknown
05:32
created

AlterCategoryNameToUnique   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
dl 0
loc 26
rs 10
c 1
b 1
f 0
wmc 2
lcom 0
cbo 1
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