Completed
Branch master (384cd7)
by Nil
04:48
created

CreateEmployeesTable   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 40
rs 10
1
<?php
2
3
namespace NilPortugues\Tests\App\Migrations;
4
5
use Illuminate\Database\Migrations\Migration;
6
use Illuminate\Database\Schema\Blueprint;
7
use Illuminate\Support\Facades\Schema;
8
9
class CreateEmployeesTable extends Migration
10
{
11
    /**
12
     * Run the migrations.
13
     */
14
    public function up()
15
    {
16
        Schema::create('employees', function (Blueprint $table) {
17
            $table->integer('id', true);
18
19
            $table->string('company', 50)->nullable()->index('company');
20
            $table->string('last_name', 50)->nullable()->index('last_name');
21
            $table->string('first_name', 50)->nullable()->index('first_name');
22
            $table->string('email_address', 50)->nullable();
23
            $table->string('job_title', 50)->nullable();
24
            $table->string('business_phone', 25)->nullable();
25
            $table->string('home_phone', 25)->nullable();
26
            $table->string('mobile_phone', 25)->nullable();
27
            $table->string('fax_number', 25)->nullable();
28
            $table->text('address')->nullable();
29
            $table->string('city', 50)->nullable()->index('city');
30
            $table->string('state_province', 50)->nullable()->index('state_province');
31
            $table->string('zip_postal_code', 15)->nullable()->index('zip_postal_code');
32
            $table->string('country_region', 50)->nullable();
33
            $table->text('web_page')->nullable();
34
            $table->text('notes')->nullable();
35
            $table->binary('attachments')->nullable();
36
        });
37
    }
38
39
    /**
40
     * Reverse the migrations.
41
     */
42
    public function down()
43
    {
44
        if (Schema::hasTable('employees')) {
45
            Schema::drop('employees');
46
        }
47
    }
48
}
49