Completed
Push — master ( 4fea39...872a00 )
by Troy
01:28
created

CreateTenantsTable::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class CreateTenantsTable extends Migration
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        $table_name = config('multi-tenant.table_name');
17
18
        Schema::create($table_name, function (Blueprint $table) {
19
            $table->increments('id');
20
            $table->integer('owner_id');
21
            $table->string('name');
22
            $table->string('slug')->index()->unique();
23
            $table->timestamps();
24
        });
25
    }
26
27
    /**
28
     * Reverse the migrations.
29
     *
30
     * @return void
31
     */
32
    public function down()
33
    {
34
        $table_name = config('multi-tenant.table_name');
35
36
        Schema::dropIfExists($table_name);
37
    }
38
}
39