Completed
Push — master ( 48d32a...4da889 )
by Igor
04:45
created

CreateEmployeesTable::up()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 24
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 20
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 24
rs 9.6
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class CreateEmployeesTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        if (config('database.connections.sqlsrv.driver') == 'sqlite') {
17
            return;
18
        }
19
20
        Schema::create('employees', function (Blueprint $table) {
21
            $table->increments('id');
22
            $table->string('full_name');
23
            $table->string('br_cpf');
24
            $table->string('email')->unique();
25
            $table->string('telephone_type');
26
            $table->string('telephone');
27
            $table->string('zip_code');
28
            $table->string('city');
29
            $table->string('state');
30
            $table->string('avenue');
31
            $table->bigInteger('number');
32
            $table->string('neighborhood');
33
            $table->string('complement');
34
            $table->string('password');
35
            $table->boolean('active');
36
            $table->rememberToken();
37
            $table->timestamps();
38
        });
39
    }
40
41
    /**
42
     * Reverse the migrations.
43
     *
44
     * @return void
45
     */
46
    public function down()
47
    {
48
        if (config('database.connections.sqlsrv.driver') == 'sqlite') {
49
            return;
50
        }
51
52
        Schema::dropIfExists('employees');
53
    }
54
}
55