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

AlterCategoryNameToUnique   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 2
c 2
b 1
f 0
lcom 0
cbo 1
dl 0
loc 26
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 6 1
A down() 0 6 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